Example #1
0
class TestObject(object):
    
    inner = vproperty(instance=InnerObject)
    x = inner.x
    y = inner.y

    nix = vproperty(type=int, fdefault=lambda self: 0)
    niy = vproperty(type=int, fdefault=lambda self: 0)
Example #2
0
 class Obj(object):
     p = vproperty()
     
     @p.getter
     def p(self):
         return self.__dict__.get('_q', 1)
     
     @p.setter
     def p(self, value):
         self.__dict__['_q'] = value
Example #3
0
 class Obj2(object):
     p = vproperty()
     
     @p.type
     def ptype(self, value):
         return self.ty(value)
Example #4
0
 class Obj(object):
     p = vproperty(type=int)
Example #5
0
 class Obj(object):
     p = vproperty(instance=int)
Example #6
0
class NotPicklable(object):
    p = vproperty()
Example #7
0
 class Obj(object):
     p = vproperty()
Example #8
0
 class Obj(object):
     p = vproperty()
     
     @p.default
     def p_default(self):
         return 12
Example #9
0
 class Obj(object):
     p = vproperty(type=int)
     
     with self.assertRaises(ValueError):
         p.delegates_to('x')
Example #10
0
class InnerObject(object):
    
    x = vproperty(fdefault=lambda self: 99)
    y = vproperty()
    nx = vproperty(type=int, fdefault=lambda self: 0)
Example #11
0
 class Outer(object):
     def __init__(self, i): self.i = i
     i = vproperty(instance=Inner)
     y = i.ii
     nx = y.nx
     x = i.ii.x
Example #12
0
 class Inner(object):
     def __init__(self, ii): self.ii = ii
     ii = vproperty(instance=InnerInner)
     nx = ii.nx
     x = ii.x
Example #13
0
 class InnerInner(object):
     def __init__(self, x): self.x = x
     x = vproperty()
     nx = vproperty(fdefault=lambda self:0, type=int)