Style question - defining immutable class data members

Rhodri James rhodri at wildebst.demon.co.uk
Sun Mar 15 12:25:15 EDT 2009


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

> "Rhodri James" <rhodri at wildebst.demon.co.uk> writes:
>
>> On Sun, 15 Mar 2009 13:26:17 -0000, Matthew Woodcraft
>
>>> 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.
>
> Not at all.
>
> He said: << Look, here's a tricky way to use a class attribute as an
> initialiser. Is this good style? >>.
>
> What was there in his post that makes you think he viewed class
> attributes purely as initialisers?

My lack of sleep :-(

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



More information about the Python-list mailing list