can I query an instance for its name?

Alex the_brain at mit.edu
Fri Sep 29 16:16:47 EDT 2000


> if __name__=="__main__":
> 	  x=foo()
> 	  x.who()	# would expect "x is an instance of class foo"

You probably want x.__class__.__name__

Alex.

-- 
Speak softly but carry a big carrot.




More information about the Python-list mailing list