In article <[EMAIL PROTECTED]>,
 Antoon Pardon <[EMAIL PROTECTED]> wrote:

> >> I don't see a big difference between these principles
> >> and the hash key principle,
> >
> > Than you haven't looked hard enough.
> 
> All of these can get unexpected behaviour because of the
> assignment-doesn't-copy semantics. The same semantics
> that can cause problems if you work with mutable dictionary
> keys.

Again, the difference is:

  1. assigning mutable objects *can* cause unexpected behavior
     (however, it's a useful feature, everyone using Python
     for longer than a day or two knows this, and then it's
     *expected* behavior.

  2. mutating dict keys *does* *always* cause problems.
     (unless you use an identity hash/cmp)

It's nonsense to forbid 1) since it's a useful feature. It's useful to 
forbid ("discourage") 2) since mutating dict keys is seldom useful (and 
when it is, Python lets you support it in your own objects).

Just
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to