types¤
Custom type annotations.
PathLike
module-attribute
¤
PathLike = Union[str, bytes, PathLike[str], PathLike[bytes]]
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
¤
ToIndices = Union[ToIndex, tuple[ToIndex, ...]]
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()
Close the stream.
Source code in src/msl/io/types.py
56 57 58 |
|
read ¤
read(size=-1)
Read from the stream.
Source code in src/msl/io/types.py
60 61 62 |
|
readline ¤
readline()
Read a line from the stream.
Source code in src/msl/io/types.py
64 65 66 |
|
seek ¤
seek(offset, whence=0)
Change the stream position to the given byte offset.
Source code in src/msl/io/types.py
68 69 70 |
|
tell ¤
tell()
Returns the current stream position.
Source code in src/msl/io/types.py
72 73 74 |
|
FileLikeWrite ¤
Bases: Protocol[T_contra]
A file-like object for writing.
SupportsRead ¤
Bases: Protocol[T_co]
A file-like object that has a read
method.
read ¤
read(size=-1)
Read from the stream.
Source code in src/msl/io/types.py
105 106 107 |
|