On 10/08/2013 06:24 AM, Steven D'Aprano wrote:
On Tue, 08 Oct 2013 12:13:48 +0200, 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
On 10/09/2013 01:00 AM, Oscar Benjamin wrote:
> On Tue, 08 Oct 2013 12:13:48 +0200, Marco Buttu wrote:
>
> > Another question is: where is the place in which this transformation
> > occurs? Is it at the parser level, before the dictionary attribute is
> > gave as argument to the metaclass?
On Oct 8, 2013 2:26 PM, "Steven D'Aprano" <
steve+comp.lang.pyt...@pearwood.info> wrote:
>
> On Tue, 08 Oct 2013 12:13:48 +0200, Marco Buttu wrote:
>
> > Another question is: where is the place in which this transformation
> > occurs? Is it at the parser level, before the dictionary attribute is
>
On 10/8/13 7:15 AM, Marco Buttu wrote:
Also, as Terry mentions, no one has ever assigned the two names you
show,
Sincerely, I can not now if someone has assigned (or will assegne) in
such way...
If you explain more about what you are building, and where this crops up
as a problem, we can
On Tue, 08 Oct 2013 12:13:48 +0200, 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.
Yes, you are correct. It s
On 10/08/2013 01:07 PM, Ned Batchelder wrote:
On 10/8/13 6:13 AM, Marco Buttu wrote:
>>> class Foo:
... _Foo__a = 100
... __a = 33
...
>>> Foo._Foo__a
33
...
You also get a "problem" if you do this:
>>> class Foo:
... a = 100
... a = 33
...
>>> Foo.a
On 10/8/13 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. Should be raising an exception (in order to
inform the user the t
On 10/08/2013 12:36 PM, Terry Reedy wrote:
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
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