Import generics from standard modules in all third-party stubs (#7791)

This commit is contained in:
Alex Waygood
2022-05-07 09:35:50 +01:00
committed by GitHub
parent 6c6c669ada
commit 5c6178a821
26 changed files with 76 additions and 59 deletions

View File

@@ -1,17 +1,20 @@
from _typeshed import StrOrBytesPath
from collections.abc import Callable
from typing import IO, Any, AnyStr, ContextManager
from contextlib import AbstractContextManager
from typing import IO, Any, AnyStr
def replace_atomic(src: AnyStr, dst: AnyStr) -> None: ...
def move_atomic(src: AnyStr, dst: AnyStr) -> None: ...
class AtomicWriter:
def __init__(self, path: StrOrBytesPath, mode: str = ..., overwrite: bool = ...) -> None: ...
def open(self) -> ContextManager[IO[Any]]: ...
def _open(self, get_fileobject: Callable[..., IO[AnyStr]]) -> ContextManager[IO[AnyStr]]: ...
def open(self) -> AbstractContextManager[IO[Any]]: ...
def _open(self, get_fileobject: Callable[..., IO[AnyStr]]) -> AbstractContextManager[IO[AnyStr]]: ...
def get_fileobject(self, dir: StrOrBytesPath | None = ..., **kwargs: Any) -> IO[Any]: ...
def sync(self, f: IO[Any]) -> None: ...
def commit(self, f: IO[Any]) -> None: ...
def rollback(self, f: IO[Any]) -> None: ...
def atomic_write(path: StrOrBytesPath, writer_cls: type[AtomicWriter] = ..., **cls_kwargs: object) -> ContextManager[IO[Any]]: ...
def atomic_write(
path: StrOrBytesPath, writer_cls: type[AtomicWriter] = ..., **cls_kwargs: object
) -> AbstractContextManager[IO[Any]]: ...