mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
Make sure classmethod signatures don't include cls, fixes #1455
This commit is contained in:
@@ -363,7 +363,7 @@ class ClassMethodGet(ValueWrapper):
|
|||||||
self._function = function
|
self._function = function
|
||||||
|
|
||||||
def get_signatures(self):
|
def get_signatures(self):
|
||||||
return self._function.get_signatures()
|
return [sig.bind(self._function) for sig in self._function.get_signatures()]
|
||||||
|
|
||||||
def py__call__(self, arguments):
|
def py__call__(self, arguments):
|
||||||
return self._function.execute(ClassMethodArguments(self._class, arguments))
|
return self._function.execute(ClassMethodArguments(self._class, arguments))
|
||||||
|
|||||||
@@ -73,8 +73,8 @@ d = functools.partial()
|
|||||||
('def f(x,/,y,* ,z): pass\n f(', 'f(x, /, y, *, z)'),
|
('def f(x,/,y,* ,z): pass\n f(', 'f(x, /, y, *, z)'),
|
||||||
('def f(a, /, *, x=3, **kwargs): pass\n f(', 'f(a, /, *, x=3, **kwargs)'),
|
('def f(a, /, *, x=3, **kwargs): pass\n f(', 'f(a, /, *, x=3, **kwargs)'),
|
||||||
|
|
||||||
(classmethod_code + 'X.x(', 'x(cls, a, b)'),
|
(classmethod_code + 'X.x(', 'x(a, b)'),
|
||||||
(classmethod_code + 'X().x(', 'x(cls, a, b)'),
|
(classmethod_code + 'X().x(', 'x(a, b)'),
|
||||||
(classmethod_code + 'X.static(', 'static(a, b)'),
|
(classmethod_code + 'X.static(', 'static(a, b)'),
|
||||||
(classmethod_code + 'X().static(', 'static(a, b)'),
|
(classmethod_code + 'X().static(', 'static(a, b)'),
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user