[PyQt] properties and interfaces with dip 0.3

Lic. José M. Rodriguez Bacallao jmrbcu at gmail.com
Wed Jul 13 17:09:37 BST 2011


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)



-- 
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
-----------------------------------------------------------------


More information about the PyQt mailing list