Python domain can now link container types automatically

Google types now greedily match the closing parenthesis.

Also removed name from returns section in Google docstrings.
Instead, everything before the colon is treated as the type.
This commit is contained in:
Ashley Whetter
2016-08-02 21:29:07 +01:00
committed by Ashley Whetter
parent 86c9767ced
commit cfd4e51802
7 changed files with 78 additions and 25 deletions

View File

@@ -211,14 +211,14 @@ class ExampleClass(object):
param1 (str): Description of `param1`.
param2 (:obj:`int`, optional): Description of `param2`. Multiple
lines are supported.
param3 (:obj:`list` of :obj:`str`): Description of `param3`.
param3 (list(str)): Description of `param3`.
"""
self.attr1 = param1
self.attr2 = param2
self.attr3 = param3 #: Doc comment *inline* with attribute
#: list of str: Doc comment *before* attribute, with type specified
#: list(str): Doc comment *before* attribute, with type specified
self.attr4 = ['attr4']
self.attr5 = None
@@ -231,7 +231,7 @@ class ExampleClass(object):
@property
def readwrite_property(self):
""":obj:`list` of :obj:`str`: Properties with both a getter and setter
"""list(str): Properties with both a getter and setter
should only be documented in their getter method.
If the setter method contains notable behavior, it should be

View File

@@ -260,7 +260,7 @@ class ExampleClass(object):
----------
param1 : str
Description of `param1`.
param2 : :obj:`list` of :obj:`str`
param2 : list(str)
Description of `param2`. Multiple
lines are supported.
param3 : :obj:`int`, optional
@@ -271,7 +271,7 @@ class ExampleClass(object):
self.attr2 = param2
self.attr3 = param3 #: Doc comment *inline* with attribute
#: list of str: Doc comment *before* attribute, with type specified
#: list(str): Doc comment *before* attribute, with type specified
self.attr4 = ["attr4"]
self.attr5 = None
@@ -284,7 +284,7 @@ class ExampleClass(object):
@property
def readwrite_property(self):
""":obj:`list` of :obj:`str`: Properties with both a getter and setter
"""list(str): Properties with both a getter and setter
should only be documented in their getter method.
If the setter method contains notable behavior, it should be