mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 22:44:27 +08:00
Add a few docstrings to make some things clearer
This commit is contained in:
@@ -621,6 +621,9 @@ class Signature(Definition):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def params(self):
|
def params(self):
|
||||||
|
"""
|
||||||
|
:return list of ParamDefinition:
|
||||||
|
"""
|
||||||
return [ParamDefinition(self._evaluator, n)
|
return [ParamDefinition(self._evaluator, n)
|
||||||
for n in self._signature.get_param_names(resolve_stars=True)]
|
for n in self._signature.get_param_names(resolve_stars=True)]
|
||||||
|
|
||||||
@@ -668,10 +671,15 @@ class CallSignature(Signature):
|
|||||||
|
|
||||||
class ParamDefinition(Definition):
|
class ParamDefinition(Definition):
|
||||||
def infer_default(self):
|
def infer_default(self):
|
||||||
|
"""
|
||||||
|
:return list of Definition:
|
||||||
|
"""
|
||||||
return _contexts_to_definitions(self._name.infer_default())
|
return _contexts_to_definitions(self._name.infer_default())
|
||||||
|
|
||||||
def infer_annotation(self, **kwargs):
|
def infer_annotation(self, **kwargs):
|
||||||
"""
|
"""
|
||||||
|
:return list of Definition:
|
||||||
|
|
||||||
:param execute_annotation: If False, the values are not executed and
|
:param execute_annotation: If False, the values are not executed and
|
||||||
you get classes instead of instances.
|
you get classes instead of instances.
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -315,7 +315,8 @@ def test_signature_is_definition(Script):
|
|||||||
|
|
||||||
# Now compare all the attributes that a CallSignature must also have.
|
# Now compare all the attributes that a CallSignature must also have.
|
||||||
for attr_name in dir(definition):
|
for attr_name in dir(definition):
|
||||||
dont_scan = ['defined_names', 'parent', 'goto_assignments', 'infer', 'params']
|
dont_scan = ['defined_names', 'parent', 'goto_assignments', 'infer',
|
||||||
|
'params', 'get_signatures']
|
||||||
if attr_name.startswith('_') or attr_name in dont_scan:
|
if attr_name.startswith('_') or attr_name in dont_scan:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user