I've passed this around some other groups, and I'm being told
"probably not possible". But I thought I'd try here as well :) This
isn't realized specifically to Maya-Python, but since I'm trying to
implement this in a module I'll use in Maya, I think it's applicable
for this list too :)
Given an object:
class Foo(object):
def __init__(self):
# stuff....
I'd like it to print, when instanced, something like this:
>>> f = Foo()
I’m assigned to f!
But it seems prohibitively hard (based on my web and forum searches)
for an object to know what variable name is has been assigned to when
created. Querying 'self' in __init__ returns a memory location, not
the variable name passed in.
If you're wondering why I'm trying to figure this out, this is just
part of my continued learning of the language and pushing the bounds,
to see what is possible ;)
Any thoughts?
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/python_inside_maya
-~----------~----~----~----~------~----~------~--~---