Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from point5 import Point >>> p1 = Point(1, 2) >>> p2 = Point(3, 4) >>> p1 + p2 >>> print p1 + p2 (4, 6) >>> print p1 (1, 2) >>> print p2 (3, 4) >>> p3 = p1 + p2 >>> print p3 (4, 6) >>> class C(object): ... x = 5 ... >>> a = C() >>> C.x, a.x (5, 5) >>> C.x = 9 >>> C.x, a.x (9, 9) >>> a.x = 45 >>> C.x, a.x (9, 45) >>> C.x = 12 >>> C.x, a.x (12, 45) >>> b = C() >>> b.x 12 >>> C.x = 99 >>> C.x, b.x (99, 99) >>> a.x 45 >>> b.x = 4000 >>> C.x, b.x (99, 4000) >>> C.x = -5 >>> C.x, b.x (-5, 4000) >>> from polygon import Polygon >>> poly = Polygon ([Point(0, 0), Point(0, 2), Point(2, 2), Point(2, 0)]) >>> poly.perimeter() # slow 8.0 >>> from rectangle import Rectangle >>> rect = Rectangle ([Point(0, 0), Point(0, 2), Point(2, 2), Point(2, 0)]) >>> rect.perimeter() # faster 8.0 >>> rect.s1 2.0 >>> poly.s1 # arbitrary polys don't have s1 Traceback (most recent call last): File "", line 1, in AttributeError: 'Polygon' object has no attribute 's1' >>> from stack import Stack >>> s = Stack() >>> s.push (2) >>> s.push(3) >>> s.is_empty() False >>> s.size() 2 >>> s.pop() 3 >>> s.pop() 2 >>> s.pop() Traceback (most recent call last): File "", line 1, in File "stack.py", line 10, in pop return self.items.pop() IndexError: pop from empty list >>>