types¤
Custom type annotations.
PathLike
module-attribute
¤
ReadLike
module-attribute
¤
ReadLike = Union[FileLikeRead[str], FileLikeRead[bytes]]
A file-like object for reading str or bytes.
ShapeLike
module-attribute
¤
ShapeLike = Union[SupportsIndex, Sequence[SupportsIndex]]
Anything that can be coerced to a shape tuple for an ndarray.
ToIndex
module-attribute
¤
ToIndex = Union[SupportsIndex, slice, EllipsisType, None]
Anything that can be used as the key for numpy.ndarray.__setitem__.
ToIndices
module-attribute
¤
Anything that can be used as the key for numpy.ndarray.__setitem__.
WriteLike
module-attribute
¤
WriteLike = Union[FileLikeWrite[str], FileLikeWrite[bytes]]
A file-like object for writing str or bytes.
FileLikeRead
¤
Bases: Iterator[T_co], Protocol[T_co]
A file-like object for reading.
close
¤
close() -> None
Close the stream.
Source code in src/msl/io/types.py
56 57 58 | |
read
¤
read(size: int | None = -1) -> T_co
Read from the stream.
Source code in src/msl/io/types.py
60 61 62 | |
readline
¤
readline() -> T_co
Read a line from the stream.
Source code in src/msl/io/types.py
64 65 66 | |
seek
¤
Change the stream position to the given byte offset.
Source code in src/msl/io/types.py
68 69 70 | |
FileLikeWrite
¤
Bases: Protocol[T_contra]
A file-like object for writing.
close
¤
close() -> None
Close the stream.
Source code in src/msl/io/types.py
89 90 91 | |
MediaDownloadProgress
¤
SupportsRead
¤
Bases: Protocol[T_co]
A file-like object that has a read method.