We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cf1da17 commit 041ceaaCopy full SHA for 041ceaa
Lib/functools.py
@@ -935,7 +935,8 @@ def _is_valid_dispatch_type(cls):
935
return (isinstance(cls, UnionType) and
936
all(isinstance(arg, type) for arg in cls.__args__))
937
938
- def _get_type_hints(func):
+ def _get_func_type_hints(func):
939
+ """Called when type hints are needed to choose the first argument to dispatch on."""
940
ann = getattr(func, '__annotate__', None)
941
if ann is None:
942
raise TypeError(
@@ -977,7 +978,7 @@ def register(cls, func=None):
977
978
f"{cls!r} is not a class or union type."
979
)
980
func = cls
- type_hints = _get_type_hints(func)
981
+ type_hints = _get_func_type_hints(func)
982
983
argname, cls = next(iter(type_hints.items()))
984
0 commit comments