[pypy-dev] re-boxing of CPython types.

Luke Kenneth Casson Leighton lkcl at lkcl.net
Thu Apr 23 11:22:41 CEST 2009


> I don't think that's what Leonardo was getting at, but rather that if
> you have to support python semantics, at some point you've got to deal
> with that overhead. For example, you have to do bounds checking on all
> list subscription, because javascript won't raise exceptions for you
> in that case.

 yep.  we have an emulation-implementation of list, dict and tuple
that raise an appropriate javascript exception that's given the same
name as the python one.  additionally, flier liu, who wrote pyv8, has
written some code into PyV8 that allows the transfer of exceptions
between a python context and a javascript context.  i believe he's
only done it one-way so far.

 ... ok - actually, you're right: looking at pyjslib.py more closely,
the only compliance with python exceptions is KeyError in the
emulation-implementation of dict, which at least demonstrates the
principle. so, one for the TODO list, then :)

hmm, i should add some tests.

l.



More information about the Pypy-dev mailing list