Does Python really follow its philosophy of "Readability counts"?

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Wed Jan 14 20:56:08 CET 2009


Paul Rubin a écrit :
> Bruno Desthuilliers <bruno.42.desthuilliers at websiteburo.invalid> writes:
>> Given that the convention for "protected" attributes in Python is to
>> prefix them with an underscore, I fail to see how one could
>> "accidentally" mess with implementation details. Typing a leading
>> underscore is rarely a typo.
> 
> We are talking about the accidental creation of new attributes in
> places outside the initializer.

Nope. This was about encapsulation and data-hiding, cf:

http://groups.google.com/group/comp.lang.python/tree/browse_frm/thread/068bc54bca830c46/049a721414f4d4da?rnum=41&_done=%2Fgroup%2Fcomp.lang.python%2Fbrowse_frm%2Fthread%2F068bc54bca830c46%3F#doc_83a09b54d386eb6c

and the convention James refered to was obviously the naming convention.





More information about the Python-list mailing list