Overriding methods in classes that use property()

Edmund Lian elian at inbrief.net
Mon Apr 22 15:11:23 EDT 2002


Thomas wrote:

>You can achive what you want with a metaclass, see code below.
>Every time a new subclass of A is created, the __metaclass__
>__init__ method is called, which retrieves the correct
>getVal and setVal methods, and creates a property from them:

Hmmm... interesting. OK, I'll check it out, thanks!

...Edmund.






More information about the Python-list mailing list