Does Python really follow its philosophy of "Readability counts"?
bruno.42.desthuilliers at websiteburo.invalid
Thu Jan 22 10:33:26 CET 2009
Steven D'Aprano a écrit :
> On Wed, 21 Jan 2009 12:54:31 +0100, Bruno Desthuilliers wrote:
>> Russ P. a écrit :
>>> In any case, I have suggested that Python should perhaps get a new
>>> keyword, "private" or "priv".
>> And quite a few people - most of them using Python daily - answered they
>> didn't wan't it.
> Then they don't have to use it.
Yes they would. Because this would become the official way to tell
what's interface and what's implementation, and *this* is the important
> Lots of people think that double-underscore name mangling is a waste of
> time: not strict enough to be useful, not open enough to be Pythonic.
> Solution? Don't use double-underscore names.
The name-mangling mechanism is actually useful when you want to make
sure some vital implementation attribute (usually of a class intented to
be extended by the library users) won't be *accidentally* overwritten.
More information about the Python-list