Skip to content

Commit 4ef7c7c

Browse files
committed
Rename ref_or_typeform to fwdref_or_typeform
1 parent 6bc698b commit 4ef7c7c

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Lib/functools.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -901,26 +901,26 @@ def _get_dispatch_annotation(func, param):
901901
import annotationlib
902902
annotations = annotationlib.get_annotations(func, format=annotationlib.Format.FORWARDREF)
903903
try:
904-
ref_or_typeform = annotations[param]
904+
fwdref_or_typeform = annotations[param]
905905
except KeyError:
906906
raise TypeError(
907907
f"Invalid first argument to `register()`: {param!r}. "
908908
f"Add missing annotation to parameter {param!r} of {func.__qualname__!r} "
909909
f"or use `@register(some_class)`."
910910
) from None
911-
if isinstance(ref_or_typeform, str):
912-
ref_or_typeform = annotationlib.ForwardRef(ref_or_typeform, owner=func)
913-
if isinstance(ref_or_typeform, annotationlib.ForwardRef):
911+
if isinstance(fwdref_or_typeform, str):
912+
fwdref_or_typeform = annotationlib.ForwardRef(fwdref_or_typeform, owner=func)
913+
if isinstance(fwdref_or_typeform, annotationlib.ForwardRef):
914914
try:
915-
ref_or_typeform = ref_or_typeform.evaluate(owner=func)
915+
fwdref_or_typeform = fwdref_or_typeform.evaluate(owner=func)
916916
except Exception:
917917
pass # Forward reference is unresolved.
918-
if ref_or_typeform is None:
919-
ref_or_typeform = type(None)
920-
if not isinstance(ref_or_typeform, annotationlib.ForwardRef):
918+
if fwdref_or_typeform is None:
919+
fwdref_or_typeform = type(None)
920+
if not isinstance(fwdref_or_typeform, annotationlib.ForwardRef):
921921
import typing
922-
ref_or_typeform = typing._strip_annotations(ref_or_typeform)
923-
return ref_or_typeform
922+
fwdref_or_typeform = typing._strip_annotations(fwdref_or_typeform)
923+
return fwdref_or_typeform
924924

925925
def _get_dispatch_param_and_annotation(func, *, skip_first=False):
926926
param = _get_dispatch_param_name(func, skip_first=skip_first)

0 commit comments

Comments
 (0)