differentmatt / filbert

JavaScript parser of Python
Other
133 stars 27 forks source link

Sorted expects JavaScript-style cmp(a, b) as key #38

Closed differentmatt closed 9 years ago

differentmatt commented 10 years ago

It should be expecting a Python-style single argument function which returns the value to use for comparison.

From https://wiki.python.org/moin/HowTo/Sorting:

The value of the key parameter should be a function that takes a single argument and returns a key to use for sorting purposes. This technique is fast because the key function is called exactly once for each input record.

differentmatt commented 9 years ago

Fixed by 15fdae5540aa76f0a945ef50de7e2b734c6ca523