Docstrings for classes should use the class name and not __init__

This commit is contained in:
Dave Halter
2019-05-05 19:35:44 +02:00
parent f71d6883d9
commit d0b0fb3cb3
+8 -3
View File
@@ -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)