caching of modules?

Mike Kayser mkayser at seas.upenn.edu
Mon Apr 29 12:39:57 EDT 2002


Hi,

I am writing a simple program (using the IDLE GUI and 2.2) that uses two
modules that I wrote. I'm in the debug phase right now, and I keep running
into the same problem: my module will have a runtime error, I go to the
module and correct the error, and then save and press ctrl-F5 (I don't even
know if the latter is necessary)... and then go back to my original program
and run again... and I get the SAME run-time error for the same line... but
I just changed the line so what it's now saying doesn't make sense.

for example:

(1) I get the error:
File "C:\Python22\project\optimize.py", line 435, in fminNCG
    print "FPRIME: " + fprime
TypeError: cannot concatenate 'str' and 'instance method' objects

(2) fprime is a function, so I change the line to
    print "FPRIME: " + str(fprime)

(3) I run again, and get the same runtime error, but with the new line. so
it will say:
  File "C:\Python22\project\optimize.py", line 435, in fminNCG
    print "FPRIME: " + str(fprime)
TypeError: cannot concatenate 'str' and 'instance method' objects


It looks to me like it's caching the module somewhere, but then when it
spits out error information it goes back to the file itself, even if it's
been modified.

Does anyone know if my hypothesis is right? If so, how can I force the
"module cache" to reload the updated file?

Thanks a million
Mike






More information about the Python-list mailing list