ram at rachum.com
Tue Sep 24 17:23:58 CEST 2013
Ethan, you've misunderstood my message and given a correct objection to an
argument I did not make.
I did not argue against ordering by insertion order on init. I agree with
that decision. I disagree with defining the entire class as an insertion
ordering class and refusing to allow users to reorder it as they wish after
Sent from my phone.
On Sep 24, 2013 4:42 PM, "Ethan Furman" <ethan at stoneleaf.us> wrote:
> On 09/24/2013 05:27 AM, Ram Rachum wrote:
>> I think that your mistake is defining OrderedDict as a dict sorting by
>> insertion order. I see no reason to define it
>> that way [...]
> How would you like it sorted?
> - ascending? you can write an algorithm for that
> - descending? you can write an algorithm for that
> - cyclic? you can write an algorithm for that
> - insertion order? you can *not* write an algorithm for that
> Insertion order is the one that you either remember, or is lost.
> As for a practical example, think of classes that want to know which order
> their attributes were created in -- OrderedDict to the rescue! :)
> Python-ideas mailing list
> Python-ideas at python.org
> --- You received this message because you are subscribed to a topic in the
> Google Groups "python-ideas" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/**
> To unsubscribe from this group and all its topics, send an email to
> python-ideas+unsubscribe@**googlegroups.com<python-ideas%2Bunsubscribe at googlegroups.com>
> For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas