Questions tagged [pypy]

PyPy is an implementation of the Python language. Do not confuse with PyPI, the package index. General Python questions should just be tagged with python.

PyPy is a fast, very compliant, self-hosting implementation of the Python language. PyPy started out being a Python interpreter written in the Python language itself. It is built using the language.

PyPy has several advantages and distinctive features, including:

  • Speed: thanks to its Just-in-Time (JIT) compiler, Python programs often run faster on PyPy.

  • Sandboxing: PyPy provides the ability to run untrusted code in a fully secure way.

  • Stackless: PyPy can be configured to run in stackless mode, providing micro-threads for massive concurrency.

Programmers interested in following PyPy's progress should check the Dev Site and the PyPy Status Blog. For background, see PyPy - Goals and Architecture Overview.

Releases and builds

At this time there are three PyPy release series with binaries for x86, ARM, and PPC, on Linux, Mac OS/X and Windows:

  • PyPy2.7 v5.6.0 (the Python2.7 compatible release)
  • PyPy3.3 v5.5.0 (the Python3.3 compatible release)
  • PyPy-STM v2.5.1 (Linux x86-64 only)

More informations about builds and versions on download page. There are also nightly builds available.

794 questions
8
votes
3 answers

easy_install with pypy while Python is installed

I installed PyPy while still having Python 2.7 on my system. How do I install and then use easy_install with PyPy? What is the syntax for distinguishing where I want to install to with easy_install? Should I set any environment variables for ease…
Jonathan Livni
  • 101,334
  • 104
  • 266
  • 359
8
votes
2 answers

PyPy - SWIG - QuickFix mix

PyPy has some compatibility limitations, especially regarding the CPython C API. I use QuickFix package which comes with precompiled SWIG bindings, and I'm considering using it with PyPy. As I am not fluent in C API and SWIG, my questions are: Does…
Jonathan Livni
  • 101,334
  • 104
  • 266
  • 359
8
votes
1 answer

When/Where does PyPy produce machine code?

I have skimmed through the PyPy implementation details and went through the source code as well, but PyPy's execution path is still not totally clear to me. Sometimes Bytecode is produced, sometimes it is skipped for immediate machine-code…
Mehdi LAMRANI
  • 11,289
  • 14
  • 88
  • 130
8
votes
1 answer

Problem setting up pypy3 as a kernel for Jupyter Notebook

I am having issues trying to setup a pypy3 kernel for a Jupyter Notebook on my Windows 10 machine. Following the instructions from these 2 other related threads (1, 2) I have used ipykernel with the command pypy3 -m pip install ipykernel but it…
solub
  • 1,291
  • 17
  • 40
8
votes
1 answer

How come CPython is faster than PyPy on the two tests "slowspitfire" and "waf"?

Judging from the benchmarks posted on the PyPy Speed Center it appears as if PyPy is faster than CPython for all but two of the tests presented. CPython is faster than PyPy on the two tests "slowspitfire" and "waf". Why is that? What kind of…
knorv
  • 49,059
  • 74
  • 210
  • 294
8
votes
2 answers

Using __slots__ under PyPy

I have this simple code that helped me to measure how classes with __slots__ perform (taken from here): import timeit def test_slots(): class Obj(object): __slots__ = ('i', 'l') def __init__(self, i): self.i = i …
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
8
votes
4 answers

Python: JIT for known bottlenecks

Is there any way to use somehow use pypy just to compile one function and not for the rest of my python program? I have a known bottleneck where I spend 99% of my CPU time (containing mostly integer shifts and XORs) and have optimized it as much as…
Jason S
  • 184,598
  • 164
  • 608
  • 970
8
votes
1 answer

PyCharm and Pypy - Unresolved reference

For some weird reason, my PyCharm loves to show unresolved errors everywhere. But only with pypy. The source runs just fine, even PyCharm can run the code perfect. But the red lines everywhere are really annoying. The problem: Ps.: I tried the…
Apache
  • 1,060
  • 5
  • 21
  • 38
8
votes
2 answers

Portable/fast way to obtain a pointer to Numpy/Numpypy data

I recently tried PyPy and was intrigued by the approach. I have lots of C extensions for Python, which all use PyArray_DATA() to obtain a pointer to the data sections of numpy arrays. Unfortunately, PyPy doesn't appear to export an equivalent for…
Stefan
  • 4,380
  • 2
  • 30
  • 33
8
votes
1 answer

Does pypy support cython extension?

I have a project which runs is run in pypy (and already achieves a nice speedup over its python counterpart). However, I do have a Cython implementation of one function which is way faster than the pypy version. So I would like to include this…
user1829358
  • 1,041
  • 2
  • 9
  • 19
8
votes
4 answers

Using Pygame with PyPy

I'm very new to python but I'd like to learn it by making games and pygame seems to be the best option. Since PyPy is the fastest implementation of python (I think) I decided to use that one. But I have no idea how to get those two working…
Luka Horvat
  • 4,283
  • 3
  • 30
  • 48
8
votes
2 answers

Usage of pypy compiler

Is there a difference in python programming while using just python and while using pypy compiler? I wanted to try using pypy so that my program execution time becomes faster. Does all the syntax that work in python works in pypy too? If there is no…
Justin Carrey
  • 3,563
  • 8
  • 32
  • 45
8
votes
1 answer

Options beyond RPython for writing interpreters w/ JITs?

I'm really interested in the PyPy project, but for the 1st (but less well-known) of its purposes listed below: A set of tools for implementing interpreters for interpreted languages An implementation of Python using this toolchain In the following…
lobsterism
  • 3,469
  • 2
  • 22
  • 36
7
votes
1 answer

Are python built-ins always C extensions (even on PyPy)?

I'm working on a documentation API for Python I'm calling Python Docs, and I've noticed that almost all built-ins can't be accessed by my static analysis suite, because they are almost exclusively C modules. As far as I can remember, I can't think…
mvanveen
  • 9,754
  • 8
  • 33
  • 42
7
votes
3 answers

Does pypy handle threads and sockets quickly compared to hand written C?

Does pypy handle threads and sockets quickly compared to hand written C? Compared to normal python? I would just try it, but the python code in question was written for a small cluster of computers on which I am not an admin. I'm asking here because…
Ian Burnette
  • 1,020
  • 10
  • 16