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 6d1f84f commit 8fda109Copy full SHA for 8fda109
mypy/stubtest.py
@@ -36,7 +36,17 @@ def __repr__(self) -> str:
36
MISSING = Missing()
37
38
T = TypeVar("T")
39
-MaybeMissing = Union[T, Missing]
+if sys.version_info >= (3, 5, 3):
40
+ MaybeMissing = Union[T, Missing]
41
+else:
42
+ # work around a bug in 3.5.2 and earlier's typing.py
43
+ class MaybeMissingMeta(type):
44
+ def __getitem__(self, arg: Any) -> Any:
45
+ return Union[arg, Missing]
46
+
47
+ class MaybeMissing(metaclass=MaybeMissingMeta): # type: ignore
48
+ pass
49
50
51
_formatter = FancyFormatter(sys.stdout, sys.stderr, False)
52
0 commit comments