Vladimir

8%
Flag icon
It is also more efficient because the key function is invoked only once per item, while the two-argument comparison is called every time the sorting algorithm needs to compare two items. Of course, Python also has to compare the keys while sorting, but that comparison is done in optimized C code and not in a Python function that you wrote.
Fluent Python: Clear, Concise, and Effective Programming
Rate this book
Clear rating
Open Preview