forked from VimPlug/jedi
Revert "Use __str__ instead of to_string"
This reverts commit 1151700114.
This commit is contained in:
@@ -309,7 +309,7 @@ class SignatureParamName(ParamNameInterface, AbstractNameDefinition):
|
||||
def string_name(self):
|
||||
return self._signature_param.name
|
||||
|
||||
def __str__(self):
|
||||
def to_string(self):
|
||||
s = self._kind_string() + self.string_name
|
||||
if self._signature_param.has_annotation:
|
||||
s += ': ' + self._signature_param.annotation_string
|
||||
@@ -341,7 +341,7 @@ class UnresolvableParamName(ParamNameInterface, AbstractNameDefinition):
|
||||
def get_kind(self):
|
||||
return Parameter.POSITIONAL_ONLY
|
||||
|
||||
def __str__(self):
|
||||
def to_string(self):
|
||||
string = self.string_name
|
||||
if self._default:
|
||||
string += '=' + self._default
|
||||
|
||||
@@ -178,7 +178,7 @@ class ParamNameInterface(_ParamMixin):
|
||||
def get_kind(self):
|
||||
raise NotImplementedError
|
||||
|
||||
def __str__(self):
|
||||
def to_string(self):
|
||||
raise NotImplementedError
|
||||
|
||||
def get_param(self):
|
||||
@@ -201,7 +201,7 @@ class BaseTreeParamName(ParamNameInterface, AbstractTreeName):
|
||||
annotation_node = None
|
||||
default_node = None
|
||||
|
||||
def __str__(self):
|
||||
def to_string(self):
|
||||
output = self._kind_string() + self.string_name
|
||||
annotation = self.annotation_node
|
||||
default = self.default_node
|
||||
@@ -277,9 +277,6 @@ class ParamNameWrapper(_ParamMixin):
|
||||
def __getattr__(self, name):
|
||||
return getattr(self._wrapped_param_name, name)
|
||||
|
||||
def __str__(self):
|
||||
return str(self._wrapped_param_name)
|
||||
|
||||
def __repr__(self):
|
||||
return '<%s: %s>' % (self.__class__.__name__, self._wrapped_param_name)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ from jedi._compatibility import Parameter
|
||||
|
||||
|
||||
class _SignatureMixin(object):
|
||||
def __str__(self):
|
||||
def to_string(self):
|
||||
def param_strings():
|
||||
is_positional = False
|
||||
is_kw_only = False
|
||||
@@ -19,7 +19,7 @@ class _SignatureMixin(object):
|
||||
yield '*'
|
||||
is_kw_only = True
|
||||
|
||||
yield str(n)
|
||||
yield n.to_string()
|
||||
|
||||
if is_positional:
|
||||
yield '/'
|
||||
|
||||
Reference in New Issue
Block a user