Skip to content

Commit

Permalink
removed unnessasary __new__ methods in DataclassStruct, TEnum a…
Browse files Browse the repository at this point in the history
…nd `TFlagsEnum`
  • Loading branch information
Tim Riddermann committed Aug 3, 2023
1 parent c405d09 commit c7e3fc7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
9 changes: 0 additions & 9 deletions construct_typed/dataclass_struct.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,6 @@ class DataclassStruct(Adapter[t.Any, t.Any, DataclassType, DataclassType]):
"""

subcon: "cs.Struct"
if t.TYPE_CHECKING:

def __new__(
cls,
dc_type: t.Type[DataclassType],
reverse: bool = False,
) -> "DataclassStruct[DataclassType]":
...

def __init__(
self,
dc_type: t.Type[DataclassType],
Expand Down
16 changes: 0 additions & 16 deletions construct_typed/tenum.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,6 @@ class TEnum(Adapter[int, int, EnumType, EnumType]):
"""
Typed enum.
"""

if t.TYPE_CHECKING:

def __new__(
cls, subcon: Construct[int, int], enum_type: t.Type[EnumType]
) -> "TEnum[EnumType]":
...

def __init__(self, subcon: Construct[int, int], enum_type: t.Type[EnumType]):
if not issubclass(enum_type, EnumBase):
raise TypeError(
Expand Down Expand Up @@ -195,14 +187,6 @@ class TFlagsEnum(Adapter[int, int, FlagsEnumType, FlagsEnumType]):
"""
Typed enum.
"""

if t.TYPE_CHECKING:

def __new__(
cls, subcon: Construct[int, int], enum_type: t.Type[FlagsEnumType]
) -> "TFlagsEnum[FlagsEnumType]":
...

def __init__(self, subcon: Construct[int, int], enum_type: t.Type[FlagsEnumType]):
if not issubclass(enum_type, FlagsEnumBase):
raise TypeError(
Expand Down

0 comments on commit c7e3fc7

Please sign in to comment.