__pycache__, one more good reason to stck with Python 2?

Flávio Lisbôa flisboa.costa at gmail.com
Mon Jan 17 20:59:15 EST 2011


That's why i disagree (and hate) the automatic compilation of code, my
project directory becomes full of object files, and then i need to either
delete everything manually or create a script to do the work (not in python,
because it'll dirt things even more :). Sometimes i notice python doesn't
recompile the .pyc in response to changes in .py (because i share my project
folders between computers using Dropbox).

Unless this is just a rant, maybe you could use the PYTHONDONTWRITEBYTECODE
environment flag or set the -B flag when executing the python interpreter.
This flag deactivates auto-compilation, and may also deactivate __pycache__
effects, but i'm not sure, i can't test it now. See
http://docs.python.org/using/cmdline.html#envvar-PYTHONDONTWRITEBYTECODE .
The implications of deactivating this behaviour are somewhat obvious, and i
wonder what impacts it'd cause on your system (but i hardly expect it to be
anything serious).

After reading some articles about it, I've come to think python depends a
lot on bytecode writing on the filesystem. I wonder if it's good or bad. I
find it so invasive, and that it should not be the default behaviour. But
that's me, i'm sure most of python users don't mind at all.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110117/a4cd8ec9/attachment.html>


More information about the Python-list mailing list