Style question - defining immutable class data members

Rhodri James rhodri at wildebst.demon.co.uk
Sun Mar 15 14:56:14 CET 2009


On Sun, 15 Mar 2009 13:26:17 -0000, Matthew Woodcraft  
<matthew at woodcraft.me.uk> wrote:

[snip Gary Herron's explanation of instance attribute lookup
falling back to class attribute lookup]

> It seems clear to me that Maxim understood all this when he asked his
> original question (you need to understand this subtlety to know why
> the trick he was asking about only works for immutable values).

It seems equally clear to me that Maxim didn't understand any of this
when he asked his original question, since he appeared to view class
attributes purely as initialisers.

Given that either of us could be right, Gary's assumption of less
understanding rather than more is clearly the safer one to take.

-- 
Rhodri James *-* Wildebeeste Herder to the Masses



More information about the Python-list mailing list