Skip to main content

internal.file

Standard library Module View source
class File
@tuple
class File[T]
Fields 1
T type
Constructors 3
__new__
__new__[mode: Literal[str]](fp: cobj)
__new__
__new__(path: str, mode: str, encoding: str = "utf-8", errors: str = "strict", newline: Optional[str] = None)
__new__
__new__(fd: int, mode: str)
Methods 9
readlines
readlines(self: Self, /) -> List[T]
readline
readline(self: Self, /) -> T
write
write(self: Self, s: T, /) -> int
read
@inline
read(self: Self, sz: int = -1, /) -> T
tell
tell(self: Self, /) -> int
seekable
seekable(self: Self, /) -> bool
seek
seek(self: Self, offset: int, whence: int, /)
flush
flush(self: Self, /)
close
close(self: Self, /)
Special methods 4
__enter__
__enter__(self: Self, /)
__exit__
__exit__(self: Self, /)
__iter__
__iter__(self: Self, /) -> Generator[T]
__file_write_gen__
__file_write_gen__[T: type](self: Self, g: Generator[T])
class gzFile
@tuple
class gzFile[T]
Fields 1
T type
Constructors 2
__new__
__new__(fp: cobj, mode: str)
__new__
__new__(path: str, mode: str, compresslevel: int = 9, encoding: str = "utf-8", errors: str = "strict", newline: Optional[str] = None)
Methods 8
close
close(self: Self)
readlines
readlines(self: Self, /) -> List[T]
readline
readline(self: Self) -> T
write
write(self: Self, s: T) -> int
read
read(self: Self, sz: int = -1) -> T
tell
tell(self: Self) -> int
seek
seek(self: Self, offset: int, whence: int)
flush
flush(self: Self)
Special methods 4
__iter__
__iter__(self: Self, /) -> Generator[T]
__enter__
__enter__(self: Self, /)
__exit__
__exit__(self: Self, /)
__file_write_gen__
__file_write_gen__[T: type](self: Self, g: Generator[T])
class bzFile
@tuple
class bzFile[T]
Fields 1
T type
Constructors 1
__new__
__new__(path: str, mode: str, compresslevel: int = 9, encoding: str = "utf-8", errors: str = "strict", newline: Optional[str] = None)
Methods 9
close
close(self: Self)
readlines
readlines(self: Self) -> List[T]
readline
readline(self: Self) -> T
write
write(self: Self, s: T) -> int
read
read(self: Self, sz: int = -1) -> T
tell
tell(self: Self) -> int
seekable
seekable(self: Self) -> bool
seek
seek(self: Self, offset: int, whence: int)
flush
flush(self: Self, /)
Special methods 4
__iter__
__iter__(self: Self, /) -> Generator[T]
__enter__
__enter__(self: Self, /)
__exit__
__exit__(self: Self, /)
__file_write_gen__
__file_write_gen__[T: type](self: Self, g: Generator[T])
function open
open(path, mode: str = "r", encoding: Optional[str] = None, errors: Optional[str] = None, newline: Optional[str] = None) -> File[str]
@overload
open[mode: Literal[str]](path, encoding: Optional[str] = None, errors: Optional[str] = None, newline: Optional[str] = None)
function gzopen
gzopen(path: str, mode: str = "rb", compresslevel: int = 9, encoding: Optional[str] = None, errors: Optional[str] = None, newline: Optional[str] = None) -> gzFile[bytes]
@overload
gzopen[mode: Literal[str]](path: str, compresslevel: int = 9, encoding: Optional[str] = None, errors: Optional[str] = None, newline: Optional[str] = None)
function bzopen
bzopen(path: str, mode: str = "rb", compresslevel: int = 9, encoding: Optional[str] = None, errors: Optional[str] = None, newline: Optional[str] = None) -> bzFile[bytes]
@overload
bzopen[mode: Literal[str]](path: str, compresslevel: int = 9, encoding: Optional[str] = None, errors: Optional[str] = None, newline: Optional[str] = None)
function is_binary
is_binary(path: str) -> bool