Introspection Class/Instance Name

*binarystar* binarystar. at binarystar.org
Wed Apr 26 01:58:30 EDT 2006


Hello there,

what method would you use to return the name of the class and/or 
instance introspectively eg.

class Bollocks:
	
	def __init__( self ):
		
		print self.__method_that_returns_class_name__()
		print self.__method_that_returns_instance_name__()


instance_of_bollocks	= Bollocks()

# Which outputs

'Bollocks'
'instance_of_bollocks'



I have been scouring the 2.4 docs ... I am sure it is frustratingly simple

thx in advance

**



More information about the Python-list mailing list