class-private names and the Zen of Python
Terry Reedy
tjreedy at udel.edu
Tue Oct 8 06:36:37 EDT 2013
On 10/8/2013 6:13 AM, Marco Buttu wrote:
> In the following case:
>
> >>> class Foo:
> ... _Foo__a = 100
> ... __a = 33
> ...
> >>> Foo._Foo__a
> 33
>
> I think this behavior, for a user who does not know the convention,
> could be a surprise.
No one qualified to use such names would do such a thing , so there is
no need to worry about it or do anything about it.
--
Terry Jan Reedy
More information about the Python-list
mailing list