Connecting Tech Pros Worldwide Forums | Help | Site Map

pyc / pyo architecture independent?

Terry Hancock
Guest
 
Posts: n/a
#1: Jul 18 '05
This question was brought up by packagers trying to set
policy for including Python modules in Debian Gnu/Linux:

Are the .pyc / .pyo files safely architecture independent?
(I.e. are they now, and are they likely or even guaranteed
to remain so?).

I know the bytecode can change between interpreter
versions and other interpreters like Jython, Stackless, and
PyPy (does that exist yet?) may not even choose to
make them. But given that the same interpreter is made
available, will they work on, say, an ARM processor,
a 68K, and a i386 sharing them on the same network?

Thanks for any comments,
Terry
--
Terry Hancock
Anansi Spaceworks http://www.AnansiSpaceworks.com/


Skip Montanaro
Guest
 
Posts: n/a
#2: Jul 18 '05

re: pyc / pyo architecture independent?



Terry> I know the bytecode can change between interpreter versions and
Terry> other interpreters like Jython, Stackless, and PyPy (does that
Terry> exist yet?) may not even choose to make them. But given that the
Terry> same interpreter is made available, will they work on, say, an
Terry> ARM processor, a 68K, and a i386 sharing them on the same
Terry> network?

Yes.

Skip

Michael Hudson
Guest
 
Posts: n/a
#3: Jul 18 '05

re: pyc / pyo architecture independent?


Terry Hancock <hancock@anansispaceworks.com> writes:
[color=blue]
> This question was brought up by packagers trying to set
> policy for including Python modules in Debian Gnu/Linux:
>
> Are the .pyc / .pyo files safely architecture independent?
> (I.e. are they now, and are they likely or even guaranteed
> to remain so?).[/color]

Yes. .pycs are marshalled code objects (mostly) so the notes in

http://www.python.org/doc/current/li...e-marshal.html

apply.

Cheers,
mwh

--
CLiki pages can be edited by anybody at any time. Imagine the most
fearsomely comprehensive legal disclaimer you have ever seen, and
double it -- http://ww.telent.net/cliki/index
Aahz
Guest
 
Posts: n/a
#4: Jul 18 '05

re: pyc / pyo architecture independent?


In article <LemdnTe8n5ZcsSeiRVn-jA@august.net>,
Terry Hancock <hancock@anansispaceworks.com> wrote:[color=blue]
>
>Are the .pyc / .pyo files safely architecture independent? (I.e. are
>they now, and are they likely or even guaranteed to remain so?).[/color]

Yes. I don't know about future guarantees, but you may be assured that
it would be a Big Change if that were no longer true.
[color=blue]
>I know the bytecode can change between interpreter versions and other
>interpreters like Jython, Stackless, and PyPy (does that exist yet?)
>may not even choose to make them. But given that the same interpreter
>is made available, will they work on, say, an ARM processor, a 68K, and
>a i386 sharing them on the same network?[/color]

Yes.
--
Aahz (aahz@pythoncraft.com) <*> http://www.pythoncraft.com/

Weinberg's Second Law: If builders built buildings the way programmers wrote
programs, then the first woodpecker that came along would destroy civilization.
Terry Hancock
Guest
 
Posts: n/a
#5: Jul 18 '05

re: pyc / pyo architecture independent?


Thank you all for the (very quick!) replies.
--
Terry Hancock
Anansi Spaceworks http://www.AnansiSpaceworks.com/

Closed Thread


Similar Python bytes