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

Re: Correct location of .py and .pyc files



On Monday 17 November 2003 09:22 am, Florent Rougon wrote:
> Josselin Mouette <josselin.mouette@ens-lyon.org> wrote:
> > Le dim 16/11/2003 à 11:34, Matthias Klose a écrit :
> >> There is no reason why /usr/share/<module> should be disallowed.
> >
> > That depends on whether .pyo files really are architecture-independent.
> > At least the generated files are different on different architectures.
> 
> Do you have a reference for this? I googled a little bit but did not
> find any reliable source for this information. In fact, the Python (2.3)
> tutorial implies the contrary (for the current optimizer, not as an
> atemporal guarantee, though):

The auxilliary files that Python generates such as .pyc / .pyo
are not intended to be relied on to be portable. This is
not so much a problem with architectures, but it is a very
big issue with choice of interpreter:  Not only is the bytecode
different between versions (or at least it's not intended to
be the same, though it might coincidentally be), but there
are now three alternative versions of Python: Jython, Stackless,
and PyPy which will generate intermediate files in completely
different ways (OTOH, I don't think they make .pyc files at all).

General practice with distributing "bytecode-only" python
dists is that the interpreter needs to go with them.  And, as
bytecode-only is highly deprecated for open-source projects,
I don't see that Debian-proper should deal with them at all.

There was some discussion on comp.lang.python about 
standardizing the bytecode awhile back, but the consensus
was that the standardized part of Python is *the source code*.
IMHO, they (/we) don't want to encourage obfuscated
distributions of Python packages.  Python is a very open-source
centric language and community.

Cheers,
Terry

--
Terry Hancock ( hancock at anansispaceworks.com )
Anansi Spaceworks  http://www.anansispaceworks.com



Reply to: