Make sure classmethod signatures don't include cls, fixes #1455

This commit is contained in:
Dave Halter
2019-12-09 08:58:49 +01:00
parent 46982ce42b
commit ed3fdf8876
2 changed files with 3 additions and 3 deletions

View File

@@ -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))

View File

@@ -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)'),