Why no lexical scoping for a method within a class?

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Wed Dec 17 22:19:43 CET 2008


walterbyrd a écrit :
> On Dec 17, 9:04 am, rdmur... at bitdance.com wrote:
> 
>> Yes.  It's called Object Oriented Programming.
> 
> I think you mean it's *Python* Object Oriented Programming. I am not
> sure that every other OO language works like that.


Every OO languages having such a thing as a global variable makes a 
distinction between an instance attributes and a global variable. Your 
problem is that you are confusing variables and attributes. In Python, 
'anything.anyname' (note the dot) is the attribute 'anyname' of object 
'anything'.



More information about the Python-list mailing list