Skip to content

Commit 6642321

Browse files
committed
Document _get_positional_param
1 parent f6ccb97 commit 6642321

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Lib/functools.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,11 @@ def _find_impl(cls, registry):
889889
return registry.get(match)
890890

891891
def _get_positional_param(func, *, pos=0):
892+
"""Finds the first user-specified parameter of a callable at position *pos*.
893+
894+
Used by singledispatch for registration by type annotation.
895+
*pos* should either be 0 (for functions and staticmethods) or 1 (for methods).
896+
"""
892897
# Fast path for typical callables.
893898
if isinstance(func, (MethodType, classmethod, staticmethod)):
894899
func = func.__func__

0 commit comments

Comments
 (0)