We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0b49ce3 commit 5645622Copy full SHA for 5645622
1 file changed
IPython/core/guarded_eval.py
@@ -577,6 +577,8 @@ def is_type_annotation(obj) -> bool:
577
return True
578
if isinstance(obj, types.GenericAlias):
579
580
+ if hasattr(types, "UnionType") and isinstance(obj, types.UnionType):
581
+ return True
582
if type(obj).__name__ in ("_GenericAlias", "_SpecialForm", "_UnionGenericAlias"):
583
584
0 commit comments