mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from _typeshed import Self
|
||||
from email.message import Message
|
||||
from types import TracebackType
|
||||
from typing import IO, Any, BinaryIO, Callable, Iterable, List, Optional, Tuple, Type, TypeVar
|
||||
from typing import IO, Any, BinaryIO, Callable, Iterable, List, Tuple, Type, TypeVar
|
||||
|
||||
_AIUT = TypeVar("_AIUT", bound=addbase)
|
||||
|
||||
@@ -10,7 +10,7 @@ class addbase(BinaryIO):
|
||||
def __init__(self, fp: IO[bytes]) -> None: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(
|
||||
self, type: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[TracebackType]
|
||||
self, type: Type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None
|
||||
) -> None: ...
|
||||
def __iter__(self: _AIUT) -> _AIUT: ...
|
||||
def __next__(self) -> bytes: ...
|
||||
@@ -29,7 +29,7 @@ class addbase(BinaryIO):
|
||||
def seek(self, offset: int, whence: int = ...) -> int: ...
|
||||
def seekable(self) -> bool: ...
|
||||
def tell(self) -> int: ...
|
||||
def truncate(self, size: Optional[int] = ...) -> int: ...
|
||||
def truncate(self, size: int | None = ...) -> int: ...
|
||||
def writable(self) -> bool: ...
|
||||
def write(self, s: bytes) -> int: ...
|
||||
def writelines(self, lines: Iterable[bytes]) -> None: ...
|
||||
@@ -47,6 +47,6 @@ class addinfo(addbase):
|
||||
class addinfourl(addinfo):
|
||||
url: str
|
||||
code: int
|
||||
def __init__(self, fp: IO[bytes], headers: Message, url: str, code: Optional[int] = ...) -> None: ...
|
||||
def __init__(self, fp: IO[bytes], headers: Message, url: str, code: int | None = ...) -> None: ...
|
||||
def geturl(self) -> str: ...
|
||||
def getcode(self) -> int: ...
|
||||
|
||||
Reference in New Issue
Block a user