How to run a single Python function using Pypy from a CPython interpreter?

Viewed 228

Is it possible to run a single Python function (or module) using Pypy from a CPython interpreter?

I imagine some use-case similar to a Numba decorator e.g.:

@pypy
def elem_sum(*containers):
    for items in zip(*containers):
        yield sum(items)

but enjoying the much wider support for Python code that Pypy has compared to Numba.

This is somewhat discussed here, but some 6 years ago, and at a multiprocessing level, where this may not be generally efficient. Also the interaction method proposed in the answer, execnet, is deprecated. Pyro5 seems to be a modern alternative to execnet (which would still promote execution at multiprocessing level).

0 Answers
Related