Skip to content

gh-105499: typing: Remove an unused function #131946

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 31, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 6 additions & 26 deletions Lib/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,7 @@
import operator
import sys
import types
from types import (
WrapperDescriptorType,
MethodWrapperType,
MethodDescriptorType,
GenericAlias,
)
from types import GenericAlias
import warnings

from _typing import (
Expand Down Expand Up @@ -354,26 +349,11 @@ def _deduplicate(params, *, unhashable_fallback=False):
if not unhashable_fallback:
raise
# Happens for cases like `Annotated[dict, {'x': IntValidator()}]`
return _deduplicate_unhashable(params)

def _deduplicate_unhashable(unhashable_params):
new_unhashable = []
for t in unhashable_params:
if t not in new_unhashable:
new_unhashable.append(t)
return new_unhashable

def _compare_args_orderless(first_args, second_args):
first_unhashable = _deduplicate_unhashable(first_args)
second_unhashable = _deduplicate_unhashable(second_args)
t = list(second_unhashable)
try:
for elem in first_unhashable:
t.remove(elem)
except ValueError:
return False
return not t

new_unhashable = []
for t in params:
if t not in new_unhashable:
new_unhashable.append(t)
return new_unhashable

def _flatten_literal_params(parameters):
"""Internal helper for Literal creation: flatten Literals among parameters."""
Expand Down
Loading