Op 2005-01-18, Steve Holden schreef <[EMAIL PROTECTED]>:
> Antoon Pardon wrote:
>
>> Op 2005-01-18, Nick Coghlan schreef <[EMAIL PROTECTED]>:
> [...]
>> But don't use mutable keys is not a general principle. It is a principle
>> introduced by the limitations of the python implementations.
>> 
> Sorry, but it *is* a general principle, adduced from the potential 
> pitfalls available to inexperienced programmers when breaking the principle.

But if these inexperienced programmers would have used dictionaries
that were implemented more safely, those pitfalls would have been
avoided. So are the pitfalls caused by breaking the principle
or by using an unsafe dictionary implementation?

>> I don't like it when a good rule of thumb because of implementation
>> limitations is sold as a general principle.
>> 
> So, since you are so good at nit-picking, perhaps you will explain the 
> difference between "rule of thumb" and "general principle".

A rule of thumb is context sensitive. If circumstances change,
so do the rules of thumb. Principles have a broader field
of application.

IMO there is nothing principally wrong with using a mutable object
as a dictionary key. But avoiding doing so is a good rule of
thumb if you have a python-like implementation of a dictionary.

-- 
Antoon Pardon
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to