4 ms·
> Let's say you have a list of events. For each event, you know the year, month, and some other data. You want them sorted chronologically. Obviously you're not
by Redoubts 11y ago
> Let's say you have a list of events. For each event, you know the year, month, and some other data. You want them sorted chronologically. Obviously you're not going to code the sort by hand. Maybe you'd consider:
Why wouldn't I just do
myList.sort(key=lambda x: castToTimestamp(x))
? Then I'm just sorting a list of integers/floats, which sounds like a solved problem.
- packetslave 11y agobecause you didn't ask how big the list was, it has 5 billion entries, and castToTimestamp is expensive?