Skip to content

Commit 004c852

Browse files
committed
Rename skip_first to skip_first_param
1 parent 4ef7c7c commit 004c852

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Lib/functools.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -888,14 +888,14 @@ def _find_impl(cls, registry):
888888
match = t
889889
return registry.get(match)
890890

891-
def _get_dispatch_param_name(func, *, skip_first=False):
891+
def _get_dispatch_param_name(func, *, skip_first_param=False):
892892
if not hasattr(func, '__code__'):
893-
skip_first = not isinstance(func, staticmethod)
893+
skip_first_param = not isinstance(func, staticmethod)
894894
func = func.__func__
895895
func_code = func.__code__
896896
pos_param_count = func_code.co_argcount
897897
params = func_code.co_varnames
898-
return next(iter(params[skip_first:pos_param_count]), None)
898+
return next(iter(params[skip_first_param:pos_param_count]), None)
899899

900900
def _get_dispatch_annotation(func, param):
901901
import annotationlib
@@ -922,8 +922,8 @@ def _get_dispatch_annotation(func, param):
922922
fwdref_or_typeform = typing._strip_annotations(fwdref_or_typeform)
923923
return fwdref_or_typeform
924924

925-
def _get_dispatch_param_and_annotation(func, *, skip_first=False):
926-
param = _get_dispatch_param_name(func, skip_first=skip_first)
925+
def _get_dispatch_param_and_annotation(func, *, skip_first_param=False):
926+
param = _get_dispatch_param_name(func, skip_first_param=skip_first_param)
927927
return param, _get_dispatch_annotation(func, param)
928928

929929
def singledispatch(func):
@@ -999,7 +999,7 @@ def register(cls, func=None, _func_is_method=False):
999999
func = cls
10001000

10011001
argname, cls = _get_dispatch_param_and_annotation(
1002-
func, skip_first=_func_is_method)
1002+
func, skip_first_param=_func_is_method)
10031003

10041004
from annotationlib import ForwardRef
10051005

0 commit comments

Comments
 (0)