Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: 0.8.1a
Fetching contributors…

Cannot retrieve contributors at this time

20 lines (18 sloc) 0.35 kb
class rectobj:
pass
def rect_area(self):
return self.x * self.y
def rect_add(self, rect):
self.x += rect.x
self.y += rect.y
def rect_init(self, x, y):
self.x = x
self.y = y
rectobj.__init__ = rect_init
rectobj.add = rect_add
rectobj.area = rect_area
x = rectobj(5, 2)
y = rectobj(2, 7)
print x.area()
x.add(y)
print x.area()
Jump to Line
Something went wrong with that request. Please try again.