Two attributes! Why?

Emanuele D'Arrigo manu3d at gmail.com
Mon Dec 1 10:43:44 EST 2008


On Nov 29, 5:21 am, Steven D'Aprano <st... at REMOVE-THIS-
cybersource.com.au> wrote:
> This is a side-effect of name-mangling. Double-underscore names are only
> mangled when they are referred to directly as attributes, not when they
> are passed to setattr, getattr etc. Those functions don't do any name
> mangling.

Ah! That make sense! Thank you!

It's a bit of an obscure thing right now. I don't see mention of it in
the description of the setattr/getattr built-ins:

http://docs.python.org/library/functions.html

Wouldn't be good to have a hint of the issue there?

Manu



More information about the Python-list mailing list