Monday, March 30, 2009

Python Shell Class Caching

I'm learning Python right now and one of the things that I thought was strange behavior was how, when you first imported a module in the shell, it would essentially be cached for the rest of your shell session. Any changes you made to your class file would not be reloaded until I exited the shell and reopened it.

There is a much simpler way to reload your class file, using the reload() command: reload(module) It would be nice if there were a 'development' mode where it never cached the class files while you were in the shell. Any suggestions?

No comments: