豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit 4372d38

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

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

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)