[Python-Dev] Tuples and underorderable types (original) (raw)
Antoine Pitrou solipsis at pitrou.net
Fri Apr 24 20:02:43 CEST 2009
- Previous message: [Python-Dev] Tuples and underorderable types
- Next message: [Python-Dev] Tuples and underorderable types
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Raymond Hettinger <python rcn.com> writes:
Would it make sense to provide a default ordering whenever the types are the same?
This doesn't work when they are not the same :-)
Instead, you could make the decorating a bit more sophisticated:
decorated = [(key, id(value), value) for key, value in blah(values)]
or even:
decorated = [(key, n, value) for n, key, value in enumerate(blah(values))]
- Previous message: [Python-Dev] Tuples and underorderable types
- Next message: [Python-Dev] Tuples and underorderable types
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]