Created
December 10, 2013 19:01
-
-
Save Spindel/7896135 to your computer and use it in GitHub Desktop.
PyPy does strange things
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def min_max_native(indata): | |
def _minmax(data): | |
_value = itemgetter(2) | |
low = min(data, key=_value) | |
high = max(data, key=_value) | |
return (_value(low), _value(high)) | |
copy = indata[:] | |
minmax = _minmax(copy) | |
return minmax | |
def min_max_sort(indata): | |
def _minmax(data): | |
_value = itemgetter(2) | |
data.sort(key=_value) | |
low = data[0] | |
high = data[-1] | |
return (_value(low), _value(high)) | |
copy = indata[:] | |
minmax = _minmax(copy) | |
return minmax | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment