mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-25 19:17:16 +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,4 +1,4 @@
|
||||
from typing import Callable, Mapping, Optional, Sequence
|
||||
from typing import Callable, Mapping, Sequence
|
||||
from typing_extensions import Final
|
||||
|
||||
paFloat32: Final[int]
|
||||
@@ -70,7 +70,7 @@ paMacCoreStreamInfo: PaMacCoreStreamInfo
|
||||
_ChannelMap = Sequence[int]
|
||||
_PaHostApiInfo = Mapping[str, str | int]
|
||||
_PaDeviceInfo = Mapping[str, str | int | float]
|
||||
_StreamCallback = Callable[[Optional[bytes], int, Mapping[str, float], int], tuple[Optional[bytes], int]]
|
||||
_StreamCallback = Callable[[bytes | None, int, Mapping[str, float], int], tuple[bytes | None, int]]
|
||||
|
||||
def get_format_from_width(width: int, unsigned: bool = ...) -> int: ...
|
||||
def get_portaudio_version() -> int: ...
|
||||
|
||||
Reference in New Issue
Block a user