Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions construct-stubs/core.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ from construct.lib import (
# type hint. But for supporting pyright/pylance, the same type hint has to be used as the return type of __new__.
# (see discussion here: https://github.com/python/typeshed/issues/4846).

StreamType = t.BinaryIO
StreamType = t.IO[bytes]
FilenameType = t.Union[str, bytes, os.PathLike[str], os.PathLike[bytes]]
PathType = str
ContextKWType = t.Any
Expand Down Expand Up @@ -75,18 +75,18 @@ class CancelParsing(ConstructError): ...
# used internally
# ===============================================================================
def stream_read(
stream: t.BinaryIO, length: int, path: t.Optional[PathType]
stream: StreamType, length: int, path: t.Optional[PathType]
) -> bytes: ...
def stream_read_entire(stream: t.BinaryIO, path: t.Optional[PathType]) -> bytes: ...
def stream_read_entire(stream: StreamType, path: t.Optional[PathType]) -> bytes: ...
def stream_write(
stream: t.BinaryIO, data: bytes, length: int, path: t.Optional[PathType]
stream: StreamType, data: bytes, length: int, path: t.Optional[PathType]
) -> None: ...
def stream_seek(
stream: t.BinaryIO, offset: int, whence: int, path: t.Optional[PathType]
stream: StreamType, offset: int, whence: int, path: t.Optional[PathType]
) -> int: ...
def stream_tell(stream: t.BinaryIO, path: t.Optional[PathType]) -> int: ...
def stream_size(stream: t.BinaryIO) -> int: ...
def stream_iseof(stream: t.BinaryIO) -> bool: ...
def stream_tell(stream: StreamType, path: t.Optional[PathType]) -> int: ...
def stream_size(stream: StreamType) -> int: ...
def stream_iseof(stream: StreamType) -> bool: ...
def evaluate(param: ConstantOrContextLambda2[T], context: Context) -> T: ...

# ===============================================================================
Expand Down