Circular reference problem -- advice?
Thomas Wouters
thomas at xs4all.net
Mon Jul 10 15:40:46 EDT 2000
On Mon, Jul 10, 2000 at 12:35:59PM -0700, Sean Blakey wrote:
> Also, your self.map looks like it duplicates the information in the builtin
> self.__dict__. Parhaps you could use that instead?
> def dispatch(self, name):
> self.__dict__[name]()
Don't forget that an instnace's __dict__ doesn't list methods, just data
members. (instance methods are created on the fly, from the unbound
versions, and not stored in the instance's __dict__.)
getattr() will work though, hadn't thought about that one ;)
--
Thomas Wouters <thomas at xs4all.net>
Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
More information about the Python-list
mailing list