Sphinx oneline param type declaration feature

allows for type definition in ":param keyword"
This commit is contained in:
Pawel Palucki
2014-07-26 22:14:28 +02:00
parent 293fa5a14f
commit d359f5d043
4 changed files with 24 additions and 4 deletions

View File

@@ -3,13 +3,14 @@
# -----------------
# sphinx style
# -----------------
def f(a, b, c, d):
def f(a, b, c, d, x):
""" asdfasdf
:param a: blablabla
:type a: str
:type b: (str, int)
:type c: threading.Thread
:type d: :class:`threading.Thread`
:param str x: blablabla
:rtype: dict
"""
#? str()
@@ -22,23 +23,28 @@ def f(a, b, c, d):
c.join
#? ['join']
d.join
#? ['lower']
x.lower
#? dict()
f()
# wrong declarations
def f(a, b):
def f(a, b, x):
"""
:param a: Forgot type declaration
:type a:
:param b: Just something
:type b: ``
:rtype:
:param x: Just something without type
:rtype:
"""
#?
a
#?
b
#?
x
#?
f()