FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-127750: Fix annotations in singledispatchmethod signature tests by johnslavik · Pull Request #143571 · python/cpython · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
11 changes: 3 additions & 8 deletions Lib/test/test_functools.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Back | FazBrowse Home | New Git URL