Attributeerror

Benjamin Niemann b.niemann at betternet.de
Fri Sep 17 10:53:29 EDT 2004


init_self wrote:
> extreme newbie question:
> 
> I have a filename.py file with an attribute named a.
> I`s a dictionary example, and when I start the interpreter
> and call the attribute its value prints out fine.
> 
> Then I change the name of the attribute from a to b and save 
> filename.py
> 
> Calling the attribute now produces an errormessage:
> Attributeerror: 'module has no attribute 'b'
> 
> This irritates me. Why does it happen?
Did you quit & restart the interpreter after changing the .py file?
Unless you explicitly say 'reload(filename)' to update the module, Python will 
not care about changes made to the file (during a single interpreter session).



More information about the Python-list mailing list