[Python-Dev] Tuples and underorderable types

Raymond Hettinger python at rcn.com
Sat Apr 25 00:23:52 CEST 2009


> I would discourage use of the decorate/sort/undecorate pattern,
> and encourage use of the key= argument. Or, if you really need
> to decorate into a tuple, still pass a key= argument.

The bug report was actually about the sched module which used
heapq to prioritize tuples consisting of times, priorities, and actions.
I fixed and closed the original bug a few hours ago but had a
thought that the pattern itself may be ubiquitious (especially with heapq).
ISTM that other bugs like this are lurking about.  But all of you 
guys seem to think the status quo is fine, so that's the end of it.

Cheers,


Raymond


More information about the Python-Dev mailing list