Python code (for Pypy)