Attributeerror

I

init_self

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?
 
B

Benjamin Niemann

init_self said:
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).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,206
Messages
2,571,069
Members
47,677
Latest member
MoisesKoeh

Latest Threads

Top