Skip to content

Commit 45c3eb8

Browse files
committed
replace hash with equal in _remove_dups_flatten
1 parent 2b622f2 commit 45c3eb8

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

Lib/typing.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -230,15 +230,11 @@ def _remove_dups_flatten(parameters):
230230
else:
231231
params.append(p)
232232
# Weed out strict duplicates, preserving the first of each occurrence.
233-
all_params = set(params)
234-
if len(all_params) < len(params):
235-
new_params = []
236-
for t in params:
237-
if t in all_params:
238-
new_params.append(t)
239-
all_params.remove(t)
240-
params = new_params
241-
assert not all_params, all_params
233+
new_params = []
234+
for p in params:
235+
if p not in new_params:
236+
new_params.append(p)
237+
params = new_params
242238
return tuple(params)
243239

244240

0 commit comments

Comments
 (0)