must the getter method is supposed to be called no, is a getter!!! On Wed, Jul 13, 2011 at 3:49 PM, Phil Thompson <[email protected]> wrote: > On Wed, 13 Jul 2011 15:17:48 -0400, Lic. José M. Rodriguez Bacallao > <[email protected]> wrote: >> in this example: >> >> class ITest(Interface): >> id = Str() >> >> @implements(ITest) >> class Test(Model): >> >> @ITest.id.getter >> def id(self): >> return 'getting id' >> >> @ITest.id.setter >> def id(self, v): >> print 'setting id' >> >> @observe('id') >> def on_change(self, change): >> print 'changing...' >> >> test = Test() >> test.id = 'xxx' >> print test.id >> >> in the case of properties, it is necessary to use the syntax: >> @Interface.attr but here I got another problem, the getter are not >> being called. Why? > > @id.setter > def id(self, v): > > Python properties work in exactly the same way. > > Phil >
-- Lic. José M. Rodriguez Bacallao Centro de Biofisica Medica ----------------------------------------------------------------- Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo. Recuerda: El arca de Noe fue construida por aficionados, el titanic por profesionales ----------------------------------------------------------------- _______________________________________________ PyQt mailing list [email protected] http://www.riverbankcomputing.com/mailman/listinfo/pyqt
