[Python-3000] sort vs order (was: What should the focus for 2.6be?)

Terry Reedy tjreedy at udel.edu
Fri Aug 25 23:08:40 CEST 2006


"Ron Adam" <rrr at ronadam.com> wrote in message 
news:ecni1g$5i8$1 at sea.gmane.org...
> Jim Jewett wrote:
>
>> The end result is that even if I find a solution that works, I think
>> it will be common (and bug-prone) enough that it really ought to be in
>> the language, or at least the standard library -- as it is today for
>> objects that don't go out of their way to prevent it.

Id() *is* in builtins.  Now that sort has a key parameter, I think an 
explicit 'key = id' qualifies enough as 'in the language' for something 
used not too often.

> The usual way to handle this in databases is to generate an unique
> id_key when the data is entered.

Which is what Python does when objects are created.

>  That also allows for duplicate entries
> such as people with the same name, or multiple items with the same part
> number.

Or multiple objects with the same value.

Terry Jan Reedy





More information about the Python-3000 mailing list