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
797
votes
12 answers

Why shouldn't I use PyPy over CPython if PyPy is 6.3 times faster?

I've been hearing a lot about the PyPy project. They claim it is 6.3 times faster than the CPython interpreter on their site. Whenever we talk about dynamic languages like Python, speed is one of the top issues. To solve this, they say PyPy is 6.3…
chhantyal
  • 11,874
  • 7
  • 51
  • 77
284
votes
4 answers

PyPy -- How can it possibly beat CPython?

From the Google Open Source Blog: PyPy is a reimplementation of Python in Python, using advanced techniques to try to attain better performance than CPython. Many years of hard work have finally paid off. Our speed results often beat…
Agnel Kurian
  • 57,975
  • 43
  • 146
  • 217
170
votes
6 answers

Why wasn't PyPy included in standard Python?

I was looking at PyPy and I was just wondering why it hasn't been adopted into the mainline Python distributions. Wouldn't things like JIT compilation and lower memory footprint greatly improve the speeds of all Python code? In short, what are the…
KLee1
  • 6,080
  • 4
  • 30
  • 41
133
votes
7 answers

Boolean identity == True vs is True

It is standard convention to use if foo is None rather than if foo == None to test if a value is specifically None. If you want to determine whether a value is exactly True (not just a true-like value), is there any reason to use if foo == True…
Uyghur Lives Matter
  • 18,820
  • 42
  • 108
  • 144
119
votes
4 answers

Why is pow(a, d, n) so much faster than a**d % n?

I was trying to implement a Miller-Rabin primality test, and was puzzled why it was taking so long (> 20 seconds) for midsize numbers (~7 digits). I eventually found the following line of code to be the source of the problem: x = a**d % n (where a,…
lyallcooper
  • 2,606
  • 2
  • 19
  • 18
95
votes
2 answers

How do you get PyPy, Django and PostgreSQL to work together?

What fork, or combination of packages should one to use to make PyPy, Django and PostgreSQL play nice together? I know that PyPy and Django play nice together, but I am less certain about PyPy and PostgreSQL. I do see that Alex Gaynor has made a…
James R
  • 4,571
  • 3
  • 30
  • 45
50
votes
2 answers

Does PyPy translate itself?

Am I getting this straight? Does the PyPy interpreter actually interpret itself and then translate itself? So here's my current understanding: RPython's toolchain involves partially executing the program to be translated to get a sort of…
alexgolec
  • 26,898
  • 33
  • 107
  • 159
44
votes
2 answers

Drawbacks to running Django under PyPy?

I understand that Django, PyPy, and Psycopg2 all work correctly together, and speed.pypy.org claims great performance improvements over CPython. Are there any downsides?
jl6
  • 6,110
  • 7
  • 35
  • 65
42
votes
5 answers

PyPy: What is all the buzz about?

Note: The title is deliberately provocative (to make you click on it and want to close-vote the question) and I don't want to look preoccupied. I've been reading and hearing more and more about PyPy. It's like a linear graph. Why is PyPy so…
sub
  • 2,653
  • 3
  • 27
  • 29
39
votes
4 answers

Install pip on pypy

I want to speed up my program so i'm trying to setup pypy + psycopg2cffi. This program opens a xml, parses it and then insert some data in a database. I'm using currently python3, postgresql and psycopg2 but this approaches is really slow. So i want…
1pa
  • 715
  • 2
  • 9
  • 23
37
votes
5 answers

how to create virtualenv with pypy?

running the following command virtualenv -p /usr/local/bin/pypy pypy exits with error like Running virtualenv with interpreter /usr/local/bin/pypy New pypy executable in pypy/bin/pypy debug: WARNING: Library path not found, using compiled-in…
minorblend
  • 905
  • 1
  • 10
  • 23
36
votes
4 answers

Eventlet or gevent or Stackless + Twisted, Pylons, Django and SQL Alchemy

We're using Twisted extensively for apps requiring a great deal of asynchronous io. There are some cases where stuff is cpu bound instead and for that we spawn a pool of processes to do the work and have a system for managing these across multiple…
Khorkrak
  • 3,911
  • 2
  • 27
  • 37
35
votes
2 answers

Compile PyPy to Exe

I know how to compile CPython file to exe using cx_freeze but is it possible to compile a simple program using PyPy to Exe ?
Nuncjo
  • 1,290
  • 3
  • 15
  • 16
34
votes
1 answer

pypy import clr fails on Windows

I tried pythonnet with pypy on Win10. It builds fine, but then fails to import clr. The crash happens after this call in the screenshot. Any tips/tools for debugging this? pypy Python 2.7.12 (aff251e54385, Nov 09 2016, 17:54:55) [PyPy 5.6.0 with…
denfromufa
  • 5,610
  • 13
  • 81
  • 138
31
votes
4 answers

how can i use pip with pypy installed from launchpad?

I have ubuntu 11.10. I apt-get installed pypy from this launchpad repository: https://launchpad.net/~pypy the computer already has python on it, and python has its own pip. How can I install pip for pypy and how can I use it differently from that of…
user1098562
  • 311
  • 1
  • 3
  • 3
1
2 3
52 53