Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions Lib/test/test_functools.py
Original file line number Diff line number Diff line change
Expand Up @@ -3448,16 +3448,11 @@ def _(item: int, arg: bytes) -> str:

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
Expand All @@ -3466,7 +3461,7 @@ def cls_func(cls, item, arg: int) -> str:
return str(arg)
@func.register
@classmethod
def _(cls, item, arg: bytes) -> str:
def _(cls, item: int, arg: bytes) -> str:
return str(item)

@functools.singledispatchmethod
Expand All @@ -3475,7 +3470,7 @@ def static_func(item, arg: int) -> str:
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)),
Expand Down
Loading