On Wed, 13 Jul 2011 12:09:37 -0400, Lic. José M. Rodriguez Bacallao <jmr...@gmail.com> wrote: > hi folks, may be this is an fool question but, how to implement > properties with interface attributes, for example, this doesn't work: > > class SomeObject(object): > def __init__(self, id): > self.id = id > > class ISomething(Interface): > id = Str() > > class Somthing(Interface): > > _internal = Instance(SomeObject) > > @ISomething.id.getter > def id(self): > return self._internal.id > > @ISomething.id.setter > def id(self, value): > return self._internal.id = value > > @_internal.default > def _internal(self): > return SomeObject(self.id)
Whether the attributes of an interface have getters and setters is part of the detail of a particular implementation of that interface. It's not part of the specification of the interface. You seem to be thinking of an interface as a base class - it isn't. Phil _______________________________________________ PyQt mailing list PyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt