Class Variable Access and Assignment

Steve Holden steve at holdenweb.com
Sat Nov 5 21:21:42 EST 2005


Steven D'Aprano wrote:
[...]
> 
> But I can't understand the position of folks who want inheritance but
> don't want the behaviour that Python currently exhibits.
> instance.attribute sometimes reading from the class attribute is a feature
> of inheritance; instance.attribute always writing to the instance is a
> feature of OOP; instance.attribute sometimes writing to the instance and
> sometimes writing to the class would be, in my opinion, not just a wart
> but a full-blown misfeature.
> 
> I ask and I ask and I ask for some use of this proposed behaviour, and
> nobody is either willing or able to tell me where how or why it would be
> useful. What should I conclude from this?
> 
> 

You should conclude that some readers of this group are happier 
designing languages with theoretical purity completely disconnected from 
users' needs. But of course we pragmatists know that practicality beats 
purity :-)

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC                     www.holdenweb.com
PyCon TX 2006                  www.python.org/pycon/




More information about the Python-list mailing list