mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-22 20:01:29 +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,5 +1,5 @@
|
||||
from _typeshed import Self, SupportsItems
|
||||
from typing import IO, Any, Callable, Iterable, Mapping, MutableMapping, Optional, Text, TypeVar, Union
|
||||
from typing import IO, Any, Callable, Iterable, Mapping, MutableMapping, Text, TypeVar, Union
|
||||
|
||||
from urllib3 import _collections
|
||||
|
||||
@@ -47,7 +47,7 @@ class SessionRedirectMixin:
|
||||
def rebuild_proxies(self, prepared_request, proxies): ...
|
||||
def should_strip_auth(self, old_url, new_url): ...
|
||||
|
||||
_Data = Union[None, Text, bytes, Mapping[str, Any], Mapping[Text, Any], Iterable[tuple[Text, Optional[Text]]], IO[Any]]
|
||||
_Data = Text | bytes | Mapping[str, Any] | Mapping[Text, Any] | Iterable[tuple[Text, Text | None]] | IO[Any] | None
|
||||
|
||||
_Hook = Callable[[Response], Any]
|
||||
_Hooks = MutableMapping[Text, _Hook | list[_Hook]]
|
||||
|
||||
Reference in New Issue
Block a user