mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-09 07:14:48 +08:00
Add params to CallSignature.__repr__
Looks like this for `jedi.Script` then:
> <CallSignature: Script index=0 params=[source=None, line=None, column=None, path=None, encoding='utf-8', sys_path=None, environment=None]>
`_params_str` could be made public, and then could be used in jedi-vim,
which currently has this:
params = [p.description.replace('\n', '').replace('param ', '', 1)
for p in signature.params]
08792d3fd7/pythonx/jedi_vim.py (L492-L493)
This commit is contained in:
committed by
Dave Halter
parent
1e796fc08d
commit
72a8ceed76
@@ -638,9 +638,18 @@ class CallSignature(Definition):
|
||||
"""
|
||||
return self._bracket_start_pos
|
||||
|
||||
@property
|
||||
def _params_str(self):
|
||||
return ', '.join([p.description[6:]
|
||||
for p in self.params])
|
||||
|
||||
def __repr__(self):
|
||||
return '<%s: %s index %s>' % \
|
||||
(type(self).__name__, self._name.string_name, self.index)
|
||||
return '<%s: %s index=%r params=[%s]>' % (
|
||||
type(self).__name__,
|
||||
self._name.string_name,
|
||||
self._index,
|
||||
self._params_str,
|
||||
)
|
||||
|
||||
|
||||
class _Help(object):
|
||||
|
||||
Reference in New Issue
Block a user