What a curious assignment.

Steven D'Aprano steve at REMOVETHIScyber.com.au
Wed Nov 23 16:48:28 EST 2005


On Wed, 23 Nov 2005 00:17:32 -0800, bonono at gmail.com wrote:

> 
> Steven D'Aprano wrote:
>> Neil.Jin at gmail.com wrote:
>>
>> > Is there somthing wrong????
>>
>> Kids today, don't they learn about inheritence? :-)

[snip]

> I believe he knows about inheritance, 

Hence my smiley.

> but not about the behaviour of
> the assignment. 

Which he now knows, based on trying it and seeing what happens.


> In many other OO languages, I believe you cannot have
> the same name for both instance variable and class variable. javascript
> has similar behaviour.

I don't believe that is the problem. If that were the problem, the
original poster wouldn't have even tried to assign to the instance and the
class separately, surely.


-- 
Steven.




More information about the Python-list mailing list