Skip to content

Commit 113cc29

Browse files
committed
Rephrase the documentation again
1 parent 552daaf commit 113cc29

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Lib/functools.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -889,12 +889,13 @@ def _find_impl(cls, registry):
889889
return registry.get(match)
890890

891891
def _get_positional_param(func, *, pos=0):
892-
"""Finds the first positional user-specified parameter of a callable at position *pos*.
892+
"""Finds the first positional user-specified parameter at position *pos*
893+
of a callable or descriptor.
893894
894895
Used by singledispatch for registration by type annotation.
895896
*pos* should either be 0 (for functions and staticmethods) or 1 (for methods).
896897
"""
897-
# Fast path for typical callable objects.
898+
# Fast path for typical callables and descriptors.
898899
if isinstance(func, (MethodType, classmethod, staticmethod)):
899900
func = func.__func__
900901
if isinstance(func, FunctionType) and not hasattr(func, "__wrapped__"):
@@ -903,7 +904,7 @@ def _get_positional_param(func, *, pos=0):
903904
return func_code.co_varnames[:func_code.co_argcount][pos]
904905
except IndexError:
905906
pass
906-
# Fallback path for more nuanced inspection of ambiguous callable objects.
907+
# Fallback path for more nuanced inspection of ambiguous callables.
907908
import inspect
908909
for param in list(inspect.signature(func).parameters.values())[pos:]:
909910
if param.kind in (param.KEYWORD_ONLY, param.VAR_KEYWORD):

0 commit comments

Comments
 (0)