mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-28 05:42:10 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from _typeshed import StrPath
|
||||
from typing import Any, BinaryIO, Callable, List, Optional, Protocol, Union, overload
|
||||
from typing import Any, BinaryIO, Callable, List, Protocol, overload
|
||||
|
||||
class _ReadableBinary(Protocol):
|
||||
def tell(self) -> int: ...
|
||||
@@ -7,8 +7,8 @@ class _ReadableBinary(Protocol):
|
||||
def seek(self, offset: int) -> Any: ...
|
||||
|
||||
@overload
|
||||
def what(file: Union[StrPath, _ReadableBinary], h: None = ...) -> Optional[str]: ...
|
||||
def what(file: StrPath | _ReadableBinary, h: None = ...) -> str | None: ...
|
||||
@overload
|
||||
def what(file: Any, h: bytes) -> Optional[str]: ...
|
||||
def what(file: Any, h: bytes) -> str | None: ...
|
||||
|
||||
tests: List[Callable[[bytes, Optional[BinaryIO]], Optional[str]]]
|
||||
tests: List[Callable[[bytes, BinaryIO | None], str | None]]
|
||||
|
||||
Reference in New Issue
Block a user