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.
1 parent 0bc7fe6 commit 35f53feCopy full SHA for 35f53fe
src/typing_extensions.py
@@ -878,7 +878,9 @@ def inner(func):
878
return inner
879
880
881
-if not hasattr(typing, "NoDefault") or not hasattr(typing, "NoExtraItems"):
+_NEEDS_SINGLETONMETA = not hasattr(typing, "NoDefault") or not hasattr(typing, "NoExtraItems")
882
+
883
+if _NEEDS_SINGLETONMETA:
884
class SingletonMeta(type):
885
def __setattr__(cls, attr, value):
886
# TypeError is consistent with the behavior of NoneType
@@ -927,7 +929,7 @@ def __reduce__(self):
927
929
NoExtraItems = NoExtraItemsType()
928
930
del NoExtraItemsType
931
932
933
del SingletonMeta
934
935
0 commit comments