mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Only add sorted if < 2.4.0
This commit is contained in:
parent
f7a3504a93
commit
3904672c2f
@ -431,7 +431,8 @@ def sortBy(f, L):
|
||||
for (i, elt) in enumerate(L):
|
||||
L[i] = L[i][2]
|
||||
|
||||
def sorted(iterable, cmp=None, key=None, reversed=False):
|
||||
if sys.version_info < (2, 4, 0):
|
||||
def sorted(iterable, cmp=None, key=None, reversed=False):
|
||||
L = list(iterable)
|
||||
if key is not None:
|
||||
assert cmp is None, 'Can\'t use both cmp and key.'
|
||||
@ -442,7 +443,7 @@ def sorted(iterable, cmp=None, key=None, reversed=False):
|
||||
L.reverse()
|
||||
return L
|
||||
|
||||
__builtins__['sorted'] = sorted
|
||||
__builtins__['sorted'] = sorted
|
||||
|
||||
def mktemp(suffix=''):
|
||||
"""Gives a decent random string, suitable for a filename."""
|
||||
|
Loading…
Reference in New Issue
Block a user