https://github.com/python/cpython/commit/0f511d8b44dd9993474402411af8c83f4964bc95
commit: 0f511d8b44dd9993474402411af8c83f4964bc95
branch: main
author: Jelle Zijlstra <jelle.zijls...@gmail.com>
committer: JelleZijlstra <jelle.zijls...@gmail.com>
date: 2025-03-31T10:27:03-07:00
summary:

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.

files:
M Lib/typing.py

diff --git a/Lib/typing.py b/Lib/typing.py
index e36da7e9f48b71..f7528258f43453 100644
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -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 (
@@ -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."""

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: arch...@mail-archive.com

Reply via email to