Skip to content

Commit c7e3fc7

Browse files
author
Tim Riddermann
committed
removed unnessasary __new__ methods in DataclassStruct, TEnum and TFlagsEnum
1 parent c405d09 commit c7e3fc7

File tree

2 files changed

+0
-25
lines changed

2 files changed

+0
-25
lines changed

construct_typed/dataclass_struct.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,6 @@ class DataclassStruct(Adapter[t.Any, t.Any, DataclassType, DataclassType]):
153153
"""
154154

155155
subcon: "cs.Struct"
156-
if t.TYPE_CHECKING:
157-
158-
def __new__(
159-
cls,
160-
dc_type: t.Type[DataclassType],
161-
reverse: bool = False,
162-
) -> "DataclassStruct[DataclassType]":
163-
...
164-
165156
def __init__(
166157
self,
167158
dc_type: t.Type[DataclassType],

construct_typed/tenum.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,6 @@ class TEnum(Adapter[int, int, EnumType, EnumType]):
9191
"""
9292
Typed enum.
9393
"""
94-
95-
if t.TYPE_CHECKING:
96-
97-
def __new__(
98-
cls, subcon: Construct[int, int], enum_type: t.Type[EnumType]
99-
) -> "TEnum[EnumType]":
100-
...
101-
10294
def __init__(self, subcon: Construct[int, int], enum_type: t.Type[EnumType]):
10395
if not issubclass(enum_type, EnumBase):
10496
raise TypeError(
@@ -195,14 +187,6 @@ class TFlagsEnum(Adapter[int, int, FlagsEnumType, FlagsEnumType]):
195187
"""
196188
Typed enum.
197189
"""
198-
199-
if t.TYPE_CHECKING:
200-
201-
def __new__(
202-
cls, subcon: Construct[int, int], enum_type: t.Type[FlagsEnumType]
203-
) -> "TFlagsEnum[FlagsEnumType]":
204-
...
205-
206190
def __init__(self, subcon: Construct[int, int], enum_type: t.Type[FlagsEnumType]):
207191
if not issubclass(enum_type, FlagsEnumBase):
208192
raise TypeError(

0 commit comments

Comments
 (0)