mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-23 04:11:28 +08:00
Use new union syntax in rest of stdlib (#5884)
This commit is contained in:
@@ -15,31 +15,21 @@ if sys.version_info >= (3, 8):
|
||||
def release(self) -> None: ...
|
||||
_BufferCallback = Optional[Callable[[PickleBuffer], Any]]
|
||||
def dump(
|
||||
obj: Any,
|
||||
file: IO[bytes],
|
||||
protocol: Optional[int] = ...,
|
||||
*,
|
||||
fix_imports: bool = ...,
|
||||
buffer_callback: _BufferCallback = ...,
|
||||
obj: Any, file: IO[bytes], protocol: int | None = ..., *, fix_imports: bool = ..., buffer_callback: _BufferCallback = ...
|
||||
) -> None: ...
|
||||
def dumps(
|
||||
obj: Any, protocol: Optional[int] = ..., *, fix_imports: bool = ..., buffer_callback: _BufferCallback = ...
|
||||
obj: Any, protocol: int | None = ..., *, fix_imports: bool = ..., buffer_callback: _BufferCallback = ...
|
||||
) -> bytes: ...
|
||||
def load(
|
||||
file: IO[bytes],
|
||||
*,
|
||||
fix_imports: bool = ...,
|
||||
encoding: str = ...,
|
||||
errors: str = ...,
|
||||
buffers: Optional[Iterable[Any]] = ...,
|
||||
file: IO[bytes], *, fix_imports: bool = ..., encoding: str = ..., errors: str = ..., buffers: Iterable[Any] | None = ...
|
||||
) -> Any: ...
|
||||
def loads(
|
||||
__data: bytes, *, fix_imports: bool = ..., encoding: str = ..., errors: str = ..., buffers: Optional[Iterable[Any]] = ...
|
||||
__data: bytes, *, fix_imports: bool = ..., encoding: str = ..., errors: str = ..., buffers: Iterable[Any] | None = ...
|
||||
) -> Any: ...
|
||||
|
||||
else:
|
||||
def dump(obj: Any, file: IO[bytes], protocol: Optional[int] = ..., *, fix_imports: bool = ...) -> None: ...
|
||||
def dumps(obj: Any, protocol: Optional[int] = ..., *, fix_imports: bool = ...) -> bytes: ...
|
||||
def dump(obj: Any, file: IO[bytes], protocol: int | None = ..., *, fix_imports: bool = ...) -> None: ...
|
||||
def dumps(obj: Any, protocol: int | None = ..., *, fix_imports: bool = ...) -> bytes: ...
|
||||
def load(file: IO[bytes], *, fix_imports: bool = ..., encoding: str = ..., errors: str = ...) -> Any: ...
|
||||
def loads(data: bytes, *, fix_imports: bool = ..., encoding: str = ..., errors: str = ...) -> Any: ...
|
||||
|
||||
@@ -63,16 +53,11 @@ class Pickler:
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
def __init__(
|
||||
self,
|
||||
file: IO[bytes],
|
||||
protocol: Optional[int] = ...,
|
||||
*,
|
||||
fix_imports: bool = ...,
|
||||
buffer_callback: _BufferCallback = ...,
|
||||
self, file: IO[bytes], protocol: int | None = ..., *, fix_imports: bool = ..., buffer_callback: _BufferCallback = ...
|
||||
) -> None: ...
|
||||
def reducer_override(self, obj: Any) -> Any: ...
|
||||
else:
|
||||
def __init__(self, file: IO[bytes], protocol: Optional[int] = ..., *, fix_imports: bool = ...) -> None: ...
|
||||
def __init__(self, file: IO[bytes], protocol: int | None = ..., *, fix_imports: bool = ...) -> None: ...
|
||||
def dump(self, __obj: Any) -> None: ...
|
||||
def clear_memo(self) -> None: ...
|
||||
def persistent_id(self, obj: Any) -> Any: ...
|
||||
@@ -88,7 +73,7 @@ class Unpickler:
|
||||
fix_imports: bool = ...,
|
||||
encoding: str = ...,
|
||||
errors: str = ...,
|
||||
buffers: Optional[Iterable[Any]] = ...,
|
||||
buffers: Iterable[Any] | None = ...,
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(self, file: IO[bytes], *, fix_imports: bool = ..., encoding: str = ..., errors: str = ...) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user