@@ -888,7 +888,6 @@ def _find_impl(cls, registry):
888888 match = t
889889 return registry .get (match )
890890
891-
892891def _get_dispatch_param_name (func , * , skip_first = False ):
893892 if not hasattr (func , '__code__' ):
894893 skip_first = not isinstance (func , staticmethod )
@@ -898,7 +897,6 @@ def _get_dispatch_param_name(func, *, skip_first=False):
898897 params = func_code .co_varnames
899898 return next (iter (params [skip_first :pos_param_count ]), None )
900899
901-
902900def _get_dispatch_annotation (func , param ):
903901 import annotationlib
904902 annotations = annotationlib .get_annotations (func , format = annotationlib .Format .FORWARDREF )
@@ -919,12 +917,10 @@ def _get_dispatch_annotation(func, param):
919917 pass # Forward reference is unresolved.
920918 return ref_or_typeform
921919
922-
923920def _get_dispatch_param_and_annotation (func , * , skip_first = False ):
924921 param = _get_dispatch_param_name (func , skip_first = skip_first )
925922 return param , _get_dispatch_annotation (func , param )
926923
927-
928924def singledispatch (func ):
929925 """Single-dispatch generic function decorator.
930926
0 commit comments