diff --git a/pysph/base/point.pyx b/pysph/base/point.pyx index 46dc9c0e..fd61d9ce 100644 --- a/pysph/base/point.pyx +++ b/pysph/base/point.pyx @@ -27,23 +27,27 @@ cdef class Point: # Declared in the .pxd file. #cdef public double x, y, z - property x: - def __get__(Point self): - return self.data.x - def __set__(Point self, double x): - self.data.x = x - - property y: - def __get__(Point self): - return self.data.y - def __set__(Point self, double y): - self.data.y = y - - property z: - def __get__(Point self): - return self.data.z - def __set__(Point self, double z): - self.data.z = z + @property + def x(Point self): + return self.data.x + @x.setter + def x(Point self, double x): + self.data.x = x + + @property + def y(Point self): + return self.data.y + @y.setter + def y(Point self, double y): + self.data.y = y + + + @property + def z(Point self): + return self.data.z + @z.setter + def z(Point self, double z): + self.data.z = z ###################################################################### # `object` interface. @@ -191,17 +195,15 @@ cdef class Point: cdef class IntPoint: - property x: - def __get__(self): - return self.data.x - - property y: - def __get__(self): - return self.data.y - - property z: - def __get__(self): - return self.data.z + @property + def x(self): + return self.data.x + @property + def y(self): + return self.data.y + @property + def z(self): + return self.data.z def __init__(self, int x=0, int y=0, int z=0): self.data.x = x