I was under the impression that you have to define the attributes of
the class before using it in an instance.  Following the book
'thinking in Python',

>>> class Point:
...     """pts in 2d space"""
...
>>> print Point
__main__.Point
>>> b = Point()
>>> b.x =3
>>> b.y =4
>>> print b.y
4
>>>

Why is it not throwing an error?  This is confusing me a bit.

 sivaram
 -- 

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to