can I query an instance for its name?
Luc Lefebvre
lefebvre at med.mcgill.ca
Fri Sep 29 16:02:13 EDT 2000
More information about the Python-list mailing list
Fri Sep 29 16:02:13 EDT 2000
- Previous message (by thread): can I query an instance for its name?
- Next message (by thread): can I query an instance for its name?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi, <\newbie alert on> I have been attempting to get access to instance names, eg: class foo: def __init__(self): pass def who(self): print "%s is an instance of class %s" % (self.????, self.__class__) if __name__=="__main__": x=foo() x.who() # would expect "x is an instance of class foo" Also, is there a way to enquire as to a given classes children eg: foo.__children__? <\newbie alert off> tia
- Previous message (by thread): can I query an instance for its name?
- Next message (by thread): can I query an instance for its name?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list