name of object inside it's methods?

Moshe Zadka moshez at math.huji.ac.il
Mon Feb 28 01:43:25 EST 2000


On Mon, 28 Feb 2000, Michal Wallace (sabren) wrote:

> A) you could recursively loop through all the namespaces
>    available to your program and do an "is" check against
>    everything you find.... 

Which wouldn't work if the object doesn't have a Python visible name,
like a Python object inside a list.

> B) you could give the object a .Name attribute and just
>    use that instead. :)

class foo():
	pass
b = foo()
b.Name = "b"
a = b
print a
--
Moshe Zadka <mzadka at geocities.com>. 
INTERNET: Learn what you know.
Share what you don't.





More information about the Python-list mailing list