From 06f37c3e1d855d64040f78506059de2af8e6a028 Mon Sep 17 00:00:00 2001 From: Tim Rid <6593626+timrid@users.noreply.github.com> Date: Tue, 29 Dec 2020 14:37:21 +0100 Subject: [PATCH] - added missing variables to "Construct" class - fixed __rtruediv__ of "Construct" class --- construct-stubs/core.pyi | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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,