@@ -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
925925def _get_dispatch_param_and_annotation (func , * , skip_first = False ):
926926 param = _get_dispatch_param_name (func , skip_first = skip_first )
0 commit comments