Re-loading updated modules

Fredrik Lundh fredrik at
Tue Jun 27 15:29:58 CEST 2006

"fileexit" <mayyash at> wrote:

> Shouldn't python recompile a module if there is a later version of the
> code (.py file)?

it does, when the module is first loaded.

> While i am debuging, i always have to exit python and
> delete the pyc before every run

deleting the PYC shouldn't be necessary.

> then start it again and import the
> modules.  It seems that this is the only way for it to recompile the
> new code.


however, see the caveats on this page:

> What is going on? is this normal behaviour?

yes.  and this is tutorial stuff, too:


More information about the Python-list mailing list