internal.file

Standard library module View source
class File
@tuple
class File[T]
Fields 1
T type
Constructors 3
__new__
__new__(fp: cobj, mode: Literal[str])
__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)
readline
readline(self)
write
write(self, s: T)
read
@inline
read(self, sz: int = -1)
tell
tell(self)
seekable
seekable(self)
seek
seek(self, offset: int, whence: int)
flush
flush(self)
close
close(self)
Special methods 4
__enter__
__enter__(self)
__exit__
__exit__(self)
__iter__
__iter__(self)
__file_write_gen__
__file_write_gen__(self, g: Generator[T], T: type)
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)
readlines
readlines(self)
readline
readline(self)
write
write(self, s: T)
read
read(self, sz: int = -1)
tell
tell(self)
seek
seek(self, offset: int, whence: int)
flush
flush(self)
Special methods 4
__iter__
__iter__(self)
__enter__
__enter__(self)
__exit__
__exit__(self)
__file_write_gen__
__file_write_gen__(self, g: Generator[T], T: type)
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)
readlines
readlines(self)
readline
readline(self)
write
write(self, s: T)
read
read(self, sz: int = -1)
tell
tell(self)
seekable
seekable(self)
seek
seek(self, offset: int, whence: int)
flush
flush(self)
Special methods 4
__iter__
__iter__(self)
__enter__
__enter__(self)
__exit__
__exit__(self)
__file_write_gen__
__file_write_gen__(self, g: Generator[T], T: type)
function open
open(path, mode: str = "r", encoding: Optional[str] = None, errors: Optional[str] = None, newline: Optional[str] = None)
@overload
open(path, mode: Literal[str], 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)
@overload
gzopen(path: str, mode: Literal[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)
@overload
bzopen(path: str, mode: Literal[str], compresslevel: int = 9, encoding: Optional[str] = None, errors: Optional[str] = None, newline: Optional[str] = None)
function is_binary
is_binary(path: str)