"""
New style classes
"""
class Point :
"""Point is a class that stores a two dimensional point"""
def __init__(self, x=0, y=0) :
self.x = x
self.y = y
def __repr__(self) :
return "Point object with x = %d, y = %d" % (self.x, self.y)
class Point2 (object) :
"""Point2 is a class that stores a two dimensional point"""
def __init__(self, x=0, y=0) :
self.x = x
self.y = y
def __repr__(self) :
return "Point2 object with x = %d, y = %d" % (self.x, self.y)
p1 = Point(1, 2)
p2 = Point2(4, 6)
print type(p1)
print type(p2)
# Here's a link to a nice explanation of new vs old-style classes:
# http://docs.python.org/reference/datamodel.html#new-style-and-classic-classes
