error in tutorial for 3.0, section 9.3.3

Vincent Davis vincent at
Sat May 23 09:08:49 EDT 2009

Section 9.3.3 says that given,
class MyClass:
    """A simple example class"""
    i = 12345
    def f(self):
        return 'hello world'

and x = MyClass()
then this

x.counter = 1
while x.counter < 10:
    x.counter = x.counter * 2
del x.counter

will print 16


I am reading this section so to learn about classes but if this is right I
think I need to start over.

Vincent Davis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list