class-private names and the Zen of Python

Marco Buttu marco.buttu at gmail.com
Wed Oct 9 01:55:45 EDT 2013


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?
>
> I thought it was at the parser level and applied to assignments at class
> level and attribute assignments anywhere within a class body.
>
> I'm pretty sure there's no way to control the behaviour from Python code
> if that's what the metaclass question is getting at.
>
> Oscar

Thanks for the clear and exhaustive answers (from you and Steven).
I was looking for a way to change the default behavior of this 
transformation (just for playing a bit with metaclasses, nothing 
serious), with snippets of code like the one of Steven (by rewriting 
__new__), but now is clear there is no way to do this with metaclasses. 
Thanks again


-- 
Marco Buttu



More information about the Python-list mailing list