Accessing attributes

Marc Christiansen usenet at
Tue Jun 12 12:09:30 CEST 2007

Jeff Rollin <jeffrey.rollin at> wrote:
> I'm working with the Python Tutorial "Byte of Python" at
> I have created the attached file, but when I execute:
> %
> I get the error message:
> (Initializing Calamity Jane)
> Traceback (most recent call last):
>  File "/home/jef/bin/", line 49, in <module>
>    Person.how_many()
> AttributeError: class Person has no attribute 'how_many'
> Where am I going wrong?

The indentation of __del__, say_hi and how_many is wrong. You define
them inside __init__. Move them to the same indentation level as
__init__ and all should work.

More information about the Python-list mailing list