I originally had all of my modules in one package. I recently created a sub-package in the original package, and moved a few modules into that. My src folder, and the 2 package folders, are all in my PYTHONPATH.
Since I relocated those modules, changes that I'm making to their .py files don't seem to be making their way into the generated *$py.class files, which I believe are ultimately what get run, based on what print __FILE__
spits out.
The .class files are located in the top-level package's directory, which I believe is because the first place they are imported from is within a module that's in that package. So I think they're in the right place.
Moving the modules back to the top-level package does make the problem go away, but being forced to have all modules in one package is hardly a solution. Is there something I have to do to 'register' a module as part of a package, other than having it in a folder with an __init__.py
?
Note: The rest of this question is just the symptoms that have caused me to conclude that the .class files are not being updated when I change the .py files. You can probably skip it if you're a tl;dr kind of person :P
I put a bunch of whitespace at the start of a function, and when I step through it, the cursor follows where the code used to be.
Here is the code the IDE shows me:
and here are the local vars (note that self
has nothing bound):
After I step a couple of lines, here is the code (note the cursor position):
and the locals:
Notice that now self
has had id
and updatePeriod
bound, so those first 2 lines of code after the whitespace have clearly been executed.
If I remove the .py file entirely (stick it on the desktop or something), then obviously the IDE can't find it, so I can't step through it, but the program runs based on what code used to be (there are some obvious changes that I can tell are not in effect).
Finally, the modification dates on the relevant *$py.class files are about 4.5 hours old, despite all this fiddling I've been doing with the recent .py files over the last hour or 2.