diff --git a/construct-stubs/core.pyi b/construct-stubs/core.pyi index 8fd1711..3fe5890 100644 --- a/construct-stubs/core.pyi +++ b/construct-stubs/core.pyi @@ -63,7 +63,9 @@ class CancelParsing(ConstructError): ... # =============================================================================== # used internally # =============================================================================== -def stream_read(stream: t.BinaryIO, length: int, path: t.Optional[PathType]) -> bytes: ... +def stream_read( + stream: t.BinaryIO, length: int, path: t.Optional[PathType] +) -> bytes: ... def stream_read_entire(stream: t.BinaryIO, path: t.Optional[PathType]) -> bytes: ... def stream_write( stream: t.BinaryIO, data: bytes, length: int, path: t.Optional[PathType] @@ -82,6 +84,10 @@ ParsedType = t.TypeVar("ParsedType") BuildTypes = t.TypeVar("BuildTypes") class Construct(t.Generic[ParsedType, BuildTypes]): + name: t.Optional[str] + docs: str + flagbuildnone: bool + parsed: t.Optional[t.Callable[[ParsedType, Context], None]] def parse(self, data: BufferType, **contextkw: ContextKWType) -> ParsedType: ... def parse_stream( self, stream: StreamType, **contextkw: ContextKWType @@ -98,7 +104,7 @@ class Construct(t.Generic[ParsedType, BuildTypes]): def compile(self, filename: str = ...) -> Construct[ParsedType, BuildTypes]: ... def benchmark(self, sampledata: BufferType, filename: str = ...) -> str: ... def export_ksy(self, schemaname: str = ..., filename: str = ...) -> str: ... - def __rtruediv__(self, name: str) -> Renamed[ParsedType, BuildTypes]: ... + def __rtruediv__(self, name: t.Optional[t.AnyStr]) -> Renamed[ParsedType, BuildTypes]: ... __rdiv__: t.Callable[[str], Construct[ParsedType, BuildTypes]] def __mul__( self,