[pypy-dev] Changing the default magic number

Armin Rigo arigo at tunes.org
Tue Jul 8 17:28:50 CEST 2008


Hi Bruno,

On Mon, Jul 07, 2008 at 11:31:36AM -0300, Bruno Gola wrote:
> I'm writing code to support the new 2.5 generator stuff (PEP 342) and
> while working on that I found a code that verifies the magic number
> (in pyframe.py). The default magic in PyPy is the Python2.4 one,
> chatting with Carl we thought it's probably a good time to change it
> to the 2.5 value, as we are supporting Python 2.5.

The important thing here is the opcodes that changed their semantics
between 2.4 and 2.5.  There is the YIELD opcode which is probably the
one that you're referring to; in 2.5 it pushes a result on the value
stack, but in 2.4 it didn't.  There is also one of the IMPORT opcodes,
which pops one more argument from the stack in 2.5.  So the magic
version number in PyPy should be changed to 2.5's at the same time as
these two opcodes change their semantics in PyPy's compiler and in
pyopcode.py.


A bientot,

Armin



More information about the Pypy-dev mailing list