Skip to content

Commit 4372d38

Browse files
committed
refactor: remove unused method
1 parent 6abe8fd commit 4372d38

1 file changed

Lines changed: 0 additions & 14 deletions

File tree

src/polyfills/stdlib/functions.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -90,20 +90,6 @@ def sorted(__iterable, key=None, reverse=False):
9090
"""
9191
item_type = type(__iterable)
9292
_dict, _list, _tuple, _str = type({}), type([]), type(()), type("")
93-
94-
def key_to_cmp(key):
95-
""" Convert a key function to a cmp function.
96-
97-
Info: https://docs.python.org/3/howto/sorting.html#the-old-way-using-the-cmp-parameter
98-
"""
99-
def cmp(a, b):
100-
""" The `cmp` function does not exist on Python 3.x.
101-
102-
Source: https://stackoverflow.com/a/22490617/8965861
103-
"""
104-
return (a > b) - (a < b)
105-
106-
return lambda x, y: cmp(key(x), key(y))
10793

10894
class _ReverseCompare:
10995
"""Wrapper class to reverse comparison for a single sort key component.

0 commit comments

Comments
 (0)