Ah, I figured it out. It seems that the previous version I created of mystuff.py that does not contain the line tangerine="Living reflection of a dream"
is somehow still in the memory, while the new mystuff.py is not loaded… I quit Python and restarted, and now things work.
One solution to reload the module is to run the following:
import importlib
importlib.reload(mystuff)
I think this is important in the book as both versions are presented in the examples and I suspected people may have encountered similar errors as I did (if they are using iPython).
Oh are you doing this from within the python shell, or running it on the command line like:
python mystuff.py
If you’re doing it inside the python shell then, yes, it’ll only load the module once. If you run it from the command line then no problem at all since Python exits each time the script ends.