class MyFloat(wrap.CObject): succ = cproperty(cfuncs['myfloat_succ']) add = cmethod(cfuncs['myfloat_add']) null = cmethod(cfuncs['myfloatp_null']) def __init__(self, f): self.f = f super(MyFloat, self).__init__() def __float__(self): return self.f
class MyPoint(wrap.CObject): x = cproperty(cfuncs['point_x'], cfuncs['point_setx']) y = cproperty(cfuncs['point_y'], cfuncs['point_setx']) _cnew = cstaticmethod(cfuncs['make_point']) _cdel = cmethod(cfuncs['del_point']) dist = cmethod(cfuncs['point_dist'])
class MyInt4(MyInt): add_array = cmethod(cfuncs['myint_add_array'], arrays=[1])
class MyOutInt(MyInt): setp = cmethod(set_ptr_succ, outargs=[1]) addp = cmethod(set_ptr_add, inoutargs=[1]) complicated = cmethod(complicated, outargs=[1], inoutargs=[2, 4])
class MyInt3(MyInt2): succ = cproperty(myint_succ2) doubled = cproperty(myint_doubled) add = cmethod(myint_add2) mult = cmethod(myint_mult)
class MyInt2(MyInt1): doubled = cproperty(cfuncs['myint_doubled']) mult = cmethod(cfuncs['myint_mult'])
class MyInt1(MyInt): succ = cproperty(cfuncs['myint_succ']) add = cmethod(cfuncs['myint_add']) s_add = cstaticmethod(cfuncs['myint_add']) null = cmethod(cfuncs['myintp_null'])