From e357050dbe5d0b41cf756382221bc1ec0a4bdd04 Mon Sep 17 00:00:00 2001 From: Tim Rid <6593626+timrid@users.noreply.github.com> Date: Tue, 29 Dec 2020 19:11:03 +0100 Subject: [PATCH] changed __init__ to __new__ of FlagsEnum --- construct-stubs/core.pyi | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/construct-stubs/core.pyi b/construct-stubs/core.pyi index 5d2fae4..ea29ac5 100644 --- a/construct-stubs/core.pyi +++ b/construct-stubs/core.pyi @@ -351,15 +351,13 @@ class Enum(Adapter[int, int, ParsedType, BuildTypes]): class BitwisableString(str): def __or__(self, other: BitwisableString) -> BitwisableString: ... -class FlagsEnum( - Adapter[int, int, Container[bool], t.Union[int, str, t.Dict[str, bool]]] -): - def __init__( - self, +class FlagsEnum(Adapter[int, int, ParsedType, BuildTypes]): + def __new__( + cls, subcon: Construct[int, int], *merge: t.Union[t.Type[enum.IntEnum], t.Type[enum.IntFlag]], **flags: int - ) -> None: ... + ) -> FlagsEnum[Container[bool], t.Union[int, str, t.Dict[str, bool]]]: ... def __getattr__(self, name: str) -> BitwisableString: ... class Mapping(Adapter[SubconParsedType, SubconBuildTypes, t.Any, t.Any]):