Skip to content

Commit 0f511d8

Browse files
gh-105499: typing: Remove an unused function (#131946)
Leftover from #105511 I believe. GitHub code search found no usages other than copies of typing.py and lists of stdlib functions.
1 parent 9127b46 commit 0f511d8

File tree

1 file changed

+6
-26
lines changed

1 file changed

+6
-26
lines changed

Lib/typing.py

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,7 @@
2929
import operator
3030
import sys
3131
import types
32-
from types import (
33-
WrapperDescriptorType,
34-
MethodWrapperType,
35-
MethodDescriptorType,
36-
GenericAlias,
37-
)
32+
from types import GenericAlias
3833
import warnings
3934

4035
from _typing import (
@@ -354,26 +349,11 @@ def _deduplicate(params, *, unhashable_fallback=False):
354349
if not unhashable_fallback:
355350
raise
356351
# Happens for cases like `Annotated[dict, {'x': IntValidator()}]`
357-
return _deduplicate_unhashable(params)
358-
359-
def _deduplicate_unhashable(unhashable_params):
360-
new_unhashable = []
361-
for t in unhashable_params:
362-
if t not in new_unhashable:
363-
new_unhashable.append(t)
364-
return new_unhashable
365-
366-
def _compare_args_orderless(first_args, second_args):
367-
first_unhashable = _deduplicate_unhashable(first_args)
368-
second_unhashable = _deduplicate_unhashable(second_args)
369-
t = list(second_unhashable)
370-
try:
371-
for elem in first_unhashable:
372-
t.remove(elem)
373-
except ValueError:
374-
return False
375-
return not t
376-
352+
new_unhashable = []
353+
for t in params:
354+
if t not in new_unhashable:
355+
new_unhashable.append(t)
356+
return new_unhashable
377357

378358
def _flatten_literal_params(parameters):
379359
"""Internal helper for Literal creation: flatten Literals among parameters."""

0 commit comments

Comments
 (0)