En Fri, 03 Oct 2008 15:04:01 -0300, dmitrey <[EMAIL PROTECTED]> escribió:

I have a code
z = MyClass(some_args)
can I somehow get info in MyClass __init__ function that user uses "z"
as name of the variable?

I.e. to have __init__ function that creates field z.name with value
"z".

No. I'd just write it as:

z = MyClass(some, args, 'z')

wich is pretty simple and readable (although you have to repeat the 'z'). All the alternative ways I know of require too much black magic.

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to