def test_method_signatures(self):
class A:
- def m(self, item, arg: int) -> str:
- return str(item)
- @classmethod
- def cm(cls, item, arg: int) -> str:
- return str(item)
@functools.singledispatchmethod
def func(self, item, arg: int) -> str:
return str(item)
@func.register
- def _(self, item, arg: bytes) -> str:
+ def _(self, item: int, arg: bytes) -> str:
return str(item)
@functools.singledispatchmethod
return str(arg)
@func.register
@classmethod
- def _(cls, item, arg: bytes) -> str:
+ def _(cls, item: int, arg: bytes) -> str:
return str(item)
@functools.singledispatchmethod
return str(arg)
@func.register
@staticmethod
- def _(item, arg: bytes) -> str:
+ def _(item: int, arg: bytes) -> str:
return str(item)
self.assertEqual(str(Signature.from_callable(A.func)),