Skip to content

Commit cd10e91

Browse files
committed
Condense fast path comment
1 parent 2d1180a commit cd10e91

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

Lib/functools.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -902,9 +902,8 @@ def _get_singledispatch_annotated_param(func, *, __role__):
902902
func = func.__func__
903903
else:
904904
idx = 0 if __role__ == "function" else 1
905-
# If it is a simple function, try to read from the code object fast.
905+
# Fast path: emulate inspect._signature_from_function if possible.
906906
if isinstance(func, FunctionType) and not hasattr(func, "__wrapped__"):
907-
# Emulate inspect._signature_from_function to get the desired parameter.
908907
func_code = func.__code__
909908
try:
910909
return func_code.co_varnames[:func_code.co_argcount][idx]

0 commit comments

Comments
 (0)