mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +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:
@@ -13,8 +13,10 @@ class _SupportsTimeTuple(Protocol):
|
||||
def timetuple(self) -> time.struct_time: ...
|
||||
|
||||
_DateTimeComparable = DateTime | datetime | str | _SupportsTimeTuple
|
||||
_Marshallable = Union[None, bool, int, float, str, bytes, tuple[Any, ...], list[Any], dict[Any, Any], datetime, DateTime, Binary]
|
||||
_XMLDate = Union[int, datetime, tuple[int, ...], time.struct_time]
|
||||
_Marshallable = (
|
||||
bool | int | float | str | bytes | None | tuple[Any, ...] | list[Any] | dict[Any, Any] | datetime | DateTime | Binary
|
||||
)
|
||||
_XMLDate = int | datetime | tuple[int, ...] | time.struct_time
|
||||
_HostType = Union[tuple[str, dict[str, str]], str]
|
||||
|
||||
def escape(s: str) -> str: ... # undocumented
|
||||
|
||||
Reference in New Issue
Block a user