[Python-ideas] Positional only arguments

Arnaud Delobelle arno at marooned.org.uk
Sun May 20 10:56:18 CEST 2007


On Wed, May 16, 2007 5:25 pm, George Sakkis wrote:
[...]
>
> What's the future of "private" attributes in Py3K ? I remember Raymond
> Hettinger bringing up a challenge on c.l.py about a decorator that
> could replace the double underscore mangling and Michele Simionato
> caming up with a bytecode hack that showed it is possible.

IIRC Michele Simionato made a 'CurrentClass' name available to methods,
which contains the class that the method is defined in.  While
interesting, this doesn't help create 'private' attribute, as name
mangling does.  In fact it is possible to implement this in pure Python
using decorators and metaclasses.

I tried to take up the challenge (without bytecode hackery, which I am not
capable of) but it turned out you need to chase around the call stack a
lot!

-- 
Arnaud





More information about the Python-ideas mailing list