Michele Simionato wrote: > On Mar 1, 9:40 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> >> In <[EMAIL PROTECTED]>, Bjoern Schliessmann
>>> But what's it (__name__) good for? >> >> As objects don't know to which name they are bound, that's a good >> way to give some information in stack traces or when doing >> introspection. > > Also, the name is used by pickle to find the class of pickled > instances. Mh. I suspect there's also more to it than I see now, but this __name__ seems quite useless to me. What if I rebind the class' name after definition? Or is it really just for some manual introspection? If it is, it seems a bit of an overkill to me. >>> class Spam(object): ... pass ... >>> Ham = Spam >>> Spam = 0 >>> test = Ham() >>> test.__class__ <class '__main__.Spam'> >>> test.__class__.__name__ 'Spam' >>> Spam 0 >>> Regards, Björn -- BOFH excuse #137: User was distributing pornography on server; system seized by FBI. -- http://mail.python.org/mailman/listinfo/python-list