mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +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,6 +1,6 @@
|
||||
from abc import abstractmethod
|
||||
from types import TracebackType
|
||||
from typing import IO, Callable, MutableMapping, Optional
|
||||
from typing import IO, Callable, MutableMapping
|
||||
|
||||
from .headers import Headers
|
||||
from .types import ErrorStream, InputStream, StartResponse, WSGIApplication, WSGIEnvironment
|
||||
@@ -8,7 +8,7 @@ from .util import FileWrapper
|
||||
|
||||
__all__ = ["BaseHandler", "SimpleHandler", "BaseCGIHandler", "CGIHandler", "IISCGIHandler", "read_environ"]
|
||||
|
||||
_exc_info = tuple[Optional[type[BaseException]], Optional[BaseException], Optional[TracebackType]]
|
||||
_exc_info = tuple[type[BaseException] | None, BaseException | None, TracebackType | None]
|
||||
|
||||
def format_date_time(timestamp: float | None) -> str: ... # undocumented
|
||||
def read_environ() -> dict[str, str]: ...
|
||||
|
||||
Reference in New Issue
Block a user