1 from _typeshed import StrOrBytesPath
2 from typing import IO, Any, AnyStr, Callable, ContextManager, Text, Type
4 def replace_atomic(src: AnyStr, dst: AnyStr) -> None: ...
5 def move_atomic(src: AnyStr, dst: AnyStr) -> None: ...
7 class AtomicWriter(object):
8 def __init__(self, path: StrOrBytesPath, mode: Text = ..., overwrite: bool = ...) -> None: ...
9 def open(self) -> ContextManager[IO[Any]]: ...
10 def _open(self, get_fileobject: Callable[..., IO[AnyStr]]) -> ContextManager[IO[AnyStr]]: ...
11 def get_fileobject(self, dir: StrOrBytesPath | None = ..., **kwargs: Any) -> IO[Any]: ...
12 def sync(self, f: IO[Any]) -> None: ...
13 def commit(self, f: IO[Any]) -> None: ...
14 def rollback(self, f: IO[Any]) -> None: ...
16 def atomic_write(path: StrOrBytesPath, writer_cls: Type[AtomicWriter] = ..., **cls_kwargs: object) -> ContextManager[IO[Any]]: ...