[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Proposal: Reorganizing Python for Python 2.0



calvin@users.sourceforge.net writes:
> Now what if you install Python 2.0 and then call /usr/bin/python15?
> This will use the newly-compiled .pyc files which are incompatible.

Python handles this without doing anything nasty, thankfully... it
treats the unusable .pyc/.pyo file as if it was out-of-date or
nonexistent, and compiles the corresponding .py again.

The problem with this is that it can be quite slow, and if it needs to
be done repeatedly it defeats the purpose of having .pyc/.pyo files.
Also, if the code is in an unwritable directory -- as it will be, if
installed from a Debian package but run by a normal user -- the new
.pyc/.pyo couldn't be written anyway.  Thus, if the .pyc/.pyo files in
the package were compiled with 1.5, 2.0 would have to recompile the
.py source on every import, or vice versa.

--Rob

-- 
Rob Tillotson  N9MTB  <robt@debian.org>



Reply to: