class FileIO:
    def __enter__(self) -> FileIO: ...

    def __exit__(*args) -> None: ...

    def write(self, data: bytes | str) -> int: ...

class StringIO:
    def __init__(self, _: int | str) -> None: ...

class BytesIO:
    def __init__(self, _: int | bytes) -> None: ...
    def getvalue(self) -> bytes: ...

def open(name: str, mode: str = ...) -> FileIO:
    pass
