mirror of
https://github.com/davidhalter/jedi.git
synced 2026-05-17 05:49:37 +08:00
Docstrings for classes should use the class name and not __init__
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
from abc import abstractproperty
|
|
||||||
from jedi.parser_utils import get_call_signature
|
from jedi.parser_utils import get_call_signature
|
||||||
|
|
||||||
|
|
||||||
@@ -7,7 +6,7 @@ class AbstractSignature(object):
|
|||||||
self.context = context
|
self.context = context
|
||||||
self.is_bound = is_bound
|
self.is_bound = is_bound
|
||||||
|
|
||||||
@abstractproperty
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
return self.context.name
|
return self.context.name
|
||||||
|
|
||||||
@@ -39,7 +38,10 @@ class TreeSignature(AbstractSignature):
|
|||||||
return self._function_context.tree_node.annotation
|
return self._function_context.tree_node.annotation
|
||||||
|
|
||||||
def to_string(self, normalize=False):
|
def to_string(self, normalize=False):
|
||||||
return get_call_signature(self._function_context.tree_node)
|
return get_call_signature(
|
||||||
|
self._function_context.tree_node,
|
||||||
|
call_string=self.name.string_name,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class BuiltinSignature(AbstractSignature):
|
class BuiltinSignature(AbstractSignature):
|
||||||
@@ -47,5 +49,8 @@ class BuiltinSignature(AbstractSignature):
|
|||||||
def _function_context(self):
|
def _function_context(self):
|
||||||
return self.context
|
return self.context
|
||||||
|
|
||||||
|
def to_string(self):
|
||||||
|
return ''
|
||||||
|
|
||||||
def bind(self, context):
|
def bind(self, context):
|
||||||
raise NotImplementedError('pls implement, need test case, %s' % context)
|
raise NotImplementedError('pls implement, need test case, %s' % context)
|
||||||
|
|||||||
Reference in New Issue
Block a user