How to get the name of a variable

fredrik at pythonware.com fredrik at pythonware.com
Fri Nov 3 08:18:10 EST 2000


laskowsk at my-deja.com wrote:
> How can i get the name of a python variable from c++ when
> i have the PyObject* of it ??

the same way as you get the name of that cat you found
on your porch: the cat (object) itself cannot tell you
its name, and it doesn't really care -- so the only way
to find out what it's called is to ask all your neigh-
bours (namespaces) if it's their cat (object)...

...and don't be surprised if you'll find that it's known
by many names, or no name at all!

</F>


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list