Skip to content

Commit 041ceaa

Browse files
committed
Change function name and add docs
1 parent cf1da17 commit 041ceaa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Lib/functools.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,8 @@ def _is_valid_dispatch_type(cls):
935935
return (isinstance(cls, UnionType) and
936936
all(isinstance(arg, type) for arg in cls.__args__))
937937

938-
def _get_type_hints(func):
938+
def _get_func_type_hints(func):
939+
"""Called when type hints are needed to choose the first argument to dispatch on."""
939940
ann = getattr(func, '__annotate__', None)
940941
if ann is None:
941942
raise TypeError(
@@ -977,7 +978,7 @@ def register(cls, func=None):
977978
f"{cls!r} is not a class or union type."
978979
)
979980
func = cls
980-
type_hints = _get_type_hints(func)
981+
type_hints = _get_func_type_hints(func)
981982

982983
argname, cls = next(iter(type_hints.items()))
983984

0 commit comments

Comments
 (0)