python - When are .pyc files refreshed? -


i understand ".pyc" files compiled versions of plain-text ".py" files, created @ runtime make programs run faster. have observed few things:

  1. upon modification of "py" files, program behavior changes. indicates "py" files compiled or @ least go though sort of hashing process or compare time stamps in order tell whether or not should re-compiled.
  2. upon deleting ".pyc" files (rm *.pyc) program behavior change. indicate not being compiled on update of ".py"s.

questions:

  • how decide when compiled?
  • is there way ensure have stricter checking during development?

the .pyc files created (and possibly overwritten) when python file imported other script. if import called, python checks see if .pyc file's internal timestamp matches corresponding .py file. if does, loads .pyc; if not or if .pyc not yet exist, python compiles .py file .pyc , loads it.

what mean "stricter checking"?


Comments

Popular posts from this blog

asp.net mvc 3 - Using mvc3, I need to add a username/password to the sql connection string at runtime -

kineticjs - draw multiple lines and delete individual line -

thumbnails - jQuery image rotate on hover -