File: sphinx_demo.py

package info (click to toggle)
python-deprecated 1.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,340 kB
  • sloc: python: 1,656; makefile: 32
file content (33 lines) | stat: -rw-r--r-- 816 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# coding: utf-8
from deprecated.sphinx import deprecated
from deprecated.sphinx import versionadded
from deprecated.sphinx import versionchanged


@deprecated(
    reason="""
    This is deprecated, really. So you need to use another function.
    But I don\'t know which one.

       - The first,
       - The second.

    Just guess!
    """,
    version='0.3.0',
)
@versionchanged(
    reason='Well, I add a new feature in this function. '
           'It is very useful as you can see in the example below, so try it. '
           'This is a very very very very very long sentence.',
    version='0.2.0',
)
@versionadded(reason='Here is my new function.', version='0.1.0')
def successor(n):
    """
    Calculate the successor of a number.

    :param n: a number
    :return: number + 1
    """
    return n + 1