We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
None
1 parent e1cde59 commit 6bc698bCopy full SHA for 6bc698b
1 file changed
Lib/functools.py
@@ -912,9 +912,14 @@ def _get_dispatch_annotation(func, param):
912
ref_or_typeform = annotationlib.ForwardRef(ref_or_typeform, owner=func)
913
if isinstance(ref_or_typeform, annotationlib.ForwardRef):
914
try:
915
- return ref_or_typeform.evaluate(owner=func)
+ ref_or_typeform = ref_or_typeform.evaluate(owner=func)
916
except Exception:
917
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):
921
+ import typing
922
+ ref_or_typeform = typing._strip_annotations(ref_or_typeform)
923
return ref_or_typeform
924
925
def _get_dispatch_param_and_annotation(func, *, skip_first=False):
0 commit comments