Lambda and Function docstrings render better.

This commit is contained in:
Dave Halter
2017-05-02 08:57:03 +02:00
parent fc7cc1c814
commit 5c836a72b6
2 changed files with 15 additions and 14 deletions

View File

@@ -22,7 +22,7 @@ All nodes and leaves have these methods/properties:
Python Parser Tree Python Parser Tree
----------------- ------------------
.. automodule:: jedi.parser.python.tree .. automodule:: jedi.parser.python.tree
:members: :members:

View File

@@ -450,14 +450,15 @@ class Function(ClassOrFunc):
""" """
Used to store the parsed contents of a python function. Used to store the parsed contents of a python function.
Children: Children::
0. <Keyword: def>
1. <Name> 0. <Keyword: def>
2. parameter list (including open-paren and close-paren <Operator>s) 1. <Name>
3. or 5. <Operator: :> 2. parameter list (including open-paren and close-paren <Operator>s)
4. or 6. Node() representing function body 3. or 5. <Operator: :>
3. -> (if annotation is also present) 4. or 6. Node() representing function body
4. annotation (if present) 3. -> (if annotation is also present)
4. annotation (if present)
""" """
type = 'funcdef' type = 'funcdef'
@@ -520,12 +521,12 @@ class Lambda(Function):
""" """
Lambdas are basically trimmed functions, so give it the same interface. Lambdas are basically trimmed functions, so give it the same interface.
Children: Children::
0. <Keyword: lambda> 0. <Keyword: lambda>
*. <Param x> for each argument x *. <Param x> for each argument x
-2. <Operator: :> -2. <Operator: :>
-1. Node() representing body -1. Node() representing body
""" """
type = 'lambdef' type = 'lambdef'
__slots__ = () __slots__ = ()