[pypy-dev] How to use interperter level code from a module for app level code in another module

Yicong Huang hengha.mao at gmail.com
Sun Jun 7 09:33:55 CEST 2015


Hi Armin,

>From your explanations, spaceconfig might not apply to write the module app
code, but only for writing tests.
In this case, any alternative methods?

1. Could app code use the interpreter code from the same module? If yes, I
think we could wrap builtin module interterper function in interp_xxx.py,
and then use in app_xxx.py.
2. From module's __init__.py, it is able to import pypy.module.xxxx. Could
we write a funtion in __init__.py and then use ins app_xxx.py?

On Sun, Jun 7, 2015 at 1:05 AM, Armin Rigo <arigo at tunes.org> wrote:

> Hi Yicong,
>
> On 6 June 2015 at 08:34, Yicong Huang <hengha.mao at gmail.com> wrote:
> > class wrapAPI:
> >     spaceconfig = dict(usemodules=['thread'])
>
> The "spaceconfig" is not something magic that applies to any class.
> Only the test runner knows about it, and the class must be called
> AppTestXxx in order for it to be picked up by the test runner
> (py.test).  You must not instantiate it yourself.
>
>
> Armin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20150607/f2a1bc68/attachment.html>


More information about the pypy-dev mailing list