mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-22 02:52:07 +08:00
PEP 604: Remove some more uses of Union/Optional (#7515)
The following patterns still break mypy: 1. `type[]` at top level fails 2. `tuple[T1, T2]` at top level fails (but `tuple[T1, ...]` is fine) 3. `T1 | Callable[..., T2 | T3]` fails, but only <=3.9 This PR cleans up usage of `Union` and `Optional` outside these patterns.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
from _typeshed import Self, SupportsWrite
|
||||
from types import FrameType, TracebackType
|
||||
from typing import IO, Any, Generator, Iterable, Iterator, Mapping, Optional, overload
|
||||
from typing import IO, Any, Generator, Iterable, Iterator, Mapping, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
__all__ = [
|
||||
@@ -26,7 +26,7 @@ __all__ = [
|
||||
"walk_tb",
|
||||
]
|
||||
|
||||
_PT = tuple[str, int, str, Optional[str]]
|
||||
_PT = tuple[str, int, str, str | None]
|
||||
|
||||
def print_tb(tb: TracebackType | None, limit: int | None = ..., file: IO[str] | None = ...) -> None: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user