Public
Authored by David P. Kendal

sortable iterators for Python

Edited

Decorate your generator function with @sortable_iterator and you’ll be able to use the function as a key in sorted. It’ll only look as far ahead in each iterator as it needs to in order to sort the input array — useful if the operations for generating sort key components would otherwise use a lot of computer time or memory.

sortable_iterator.py 1.35 KB
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment