Python 3.3.1 (default, Apr 17 2013, 22:32:14) 
[GCC 4.7.3]
Type "help", "copyright", "credits" or "license" for more information.
from math import sqrt
class Point(object):
   pass

dir(Point)
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__']
id(Point)
3068566580
p1 = Point()
p1.x
Traceback (most recent call last):
  File "<string>", line 1, in <fragment>
builtins.AttributeError: 'Point' object has no attribute 'x'
p1.x = 3
p1.y = 4
p1.x
3
def distance(point, x_pos, y_pos):
   



pass

Traceback (most recent call last):
  File "<string>", line 6, in <fragment>
builtins.IndentationError: expected an indented block (<wingdb_compile>, line 6)
def distance(point):
   return sqrt(point.x**2 + point.y**2)

distance(p1)
5.0
p1.distance()
Traceback (most recent call last):
  File "<string>", line 1, in <fragment>
builtins.AttributeError: 'Point' object has no attribute 'distance'
def initialize(point, x_pos, y_pos):
   point.x = x_pos
   point.y = y_pos

p2 = Point(12, 5)
Traceback (most recent call last):
  File "<string>", line 1, in <fragment>
builtins.TypeError: object() takes no parameters
Point.__init__ = initialize
p2 = Point(12, 5)
p2.x
12
p2.y
5
p2.distance()
Traceback (most recent call last):
  File "<string>", line 1, in <fragment>
builtins.AttributeError: 'Point' object has no attribute 'distance'
distance(p2)
13.0
def distance(point):
pass

Traceback (most recent call last):
  File "<string>", line 2, in <fragment>
builtins.IndentationError: expected an indented block (<wingdb_compile>, line 2)
Point.distance = distance
p3 = Point(3, 4)
p3.x
3
p3.y
4
p3.distance()
5.0
