Skip to content

Commit 71617e0

Browse files
committed
fix duplicates
1 parent 1fdd378 commit 71617e0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tkclasswiz/object_frame/frame_base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def remove_classes(types: list):
200200
if isabstract(type_):
201201
r.remove(type_)
202202

203-
return tuple(r)
203+
return tuple({a:0 for a in r})
204204

205205
if isinstance(input_type, str):
206206
raise TypeError(
@@ -220,19 +220,19 @@ def remove_classes(types: list):
220220
for type_ in chain.from_iterable([cls.convert_types(r) for r in get_args(input_type)]):
221221
new_types.append(type_)
222222

223-
new_types = tuple(new_types)
223+
new_types = remove_classes(new_types)
224224
if origin is Union:
225225
return new_types # Just expand unions
226226

227227
# Process abstract classes and polymorphism
228228
new_origins = []
229229
for origin in cls.convert_types(origin):
230230
if issubclass_noexcept(origin, (Generic, Iterable)):
231-
new_origins.append(origin[new_types])
231+
new_origins.append(origin[tuple(new_types)])
232232
else:
233233
new_origins.append(origin)
234234

235-
return tuple(new_origins)
235+
return remove_classes(new_origins)
236236

237237
if input_type.__module__ == "builtins":
238238
# Don't consider built-int types for polymorphism

0 commit comments

Comments
 (0)