Properties transfer between instances of different classes, without subclassing

Heiko Wundram modelnine at bit-bukket.org
Sat Dec 10 05:12:43 EST 2005


Pierre wrote:
> Ideally, 'tabv.cold' would give me 'tabv', masked where the values are
> <10.
> I don't want to make 'Tabl' a subclass of 'Temp'. I'd like to use it
> more generically, so that when I define a 3rd class 'Color', I could
> initiate 'Tabv' with an instance of 'Color', accessing the 'Color'
> properties without the 'Temp' properties.

I guess interfaces could make your day:

http://www.zope.org/Products/ZopeInterface

--- Heiko.



More information about the Python-list mailing list