(  # type: ignore
        self,
        filepath: PATH_TYPES,
        mode: str = "w",
        **kw: Any
        # ) -> Generator[IO, None, None]:
    )
return filepath.open(mode=mode, **kw)
Rewrite an existing file atomically to avoid programs running in
        parallel to have race conditions while reading.
Rewrite an existing file atomically to avoid programs running in
        parallel to have race conditions while reading.
Rewrite an existing file atomically to avoid programs running in parallel to have race conditions while reading .
def rewrite(  # type: ignore
        self,
        filepath: PATH_TYPES,
        mode: str = "w",
        **kw: Any
        # ) -> Generator[IO, None, None]:
    ) -> IO:
        """Rewrite an existing file atomically to avoid programs running in
        parallel to have race conditions while reading."""
        if not isinstance(filepath, self.PATH_BACKEND):
            filepath = self.PATH_BACKEND(filepath)
        return filepath.open(mode=mode, **kw)
def rewrite ( # type: ignore self , filepath : PATH_TYPES , mode : str = "w" , * * kw : Any # ) -> Generator[IO, None, None]: ) -> IO : if not isinstance ( filepath , self . PATH_BACKEND ) : filepath = self . PATH_BACKEND ( filepath ) return filepath . open ( mode = mode , * * kw )