Name conflict in class hierarchy

bruno at modulix onurb at xiludom.gro
Tue May 23 06:45:59 EDT 2006


Scott David Daniels wrote:
> bruno at modulix wrote:
> 
>> Ralf Muschall wrote:
>>
>>> Jeffrey Barish wrote:
>>>
>>> [overriding of base class member functions by subclass] ....
>>> In Python, a function not intended to be overriden should be either
>>> have a name starting with an underscore
>>
>>
>> actually with *two* underscores. The single-leading-underscore naming
>> scheme is the convention for 'protected' (read: 'implementation, not
>> API') attributes.
> 
> 
> The double-underscore is there to generate names that are unlikely to
> accidentally conflict. 

Yes, I do know this, and uses it when appropriate (that is : almost never)

I was just correcting Ralf's wrong statement about the single leading
underscore convention meant to denote "functions not intended to be
overriden".



-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list