Newbie again: computing attributes on the fly
David Ascher
da at ski.org
Wed Jun 16 14:10:08 EDT 1999
On Wed, 16 Jun 1999, Olaf Delgado wrote:
> Yes, I definitely want to generalize that. The problem is that that method
> may be defined in a superclass, so "self.__dict__" won't find it. AFAIK
> (which may be not be very far), I have to use "hasattr" and/or "getattr",
> which in turn will call "__getattr__".
You may find that using ExtensionClass could help. See:
http://www.digicool.com/releases/ExtensionClass/
(note especially the section on computed attributes in the documentation).
--david
More information about the Python-list
mailing list