PyPy, is it a 1:1 replacement for CPython?

Discussion in 'Python' started by Simon Cropper, Jul 21, 2012.

  1. Hi,

    Can you use PyPy as a direct replacement for the normal python or is it
    a specialized compiler that can only work with libraries that are
    manipulated to operate within its constraints (if it has any).

    Are there any issues with using PyPy? For example, if programs are
    created under PyPy are they subtle different from normal code that would
    make the program incompatible with the normal compiler?

    --
    Cheers Simon

    Simon Cropper - Open Content Creator

    Free and Open Source Software Workflow Guides
    ------------------------------------------------------------
    Introduction http://www.fossworkflowguides.com
    GIS Packages http://www.fossworkflowguides.com/gis
    bash / Python http://www.fossworkflowguides.com/scripting
     
    Simon Cropper, Jul 21, 2012
    #1
    1. Advertisements

  2. On Sat, 21 Jul 2012 13:35:21 +1000, Simon Cropper wrote:

    > Hi,
    >
    > Can you use PyPy as a direct replacement for the normal python or is it
    > a specialized compiler that can only work with libraries that are
    > manipulated to operate within its constraints (if it has any).


    PyPy should work perfectly with pure-Python software. I don't know if it
    is compatible with extension libraries written in C or Fortran.


    > Are there any issues with using PyPy? For example, if programs are
    > created under PyPy are they subtle different from normal code that would
    > make the program incompatible with the normal compiler?


    I don't expect so. There may be special PyPy functions that other
    Python's won't have, but I don't know of any. If you stick to standard
    library and language features as described in the normal Python docs, you
    should be fine.


    --
    Steven
     
    Steven D'Aprano, Jul 21, 2012
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. York
    Replies:
    1
    Views:
    464
    Chris Liechti
    Sep 10, 2003
  2. Boris Boutillier

    Compiling a CPython library on Mac OSX

    Boris Boutillier, Dec 12, 2003, in forum: Python
    Replies:
    3
    Views:
    459
  3. David McNab
    Replies:
    0
    Views:
    667
    David McNab
    Apr 9, 2004
  4. Randall Smith

    jython 2 cpython bridge

    Randall Smith, May 24, 2004, in forum: Python
    Replies:
    10
    Views:
    2,038
    John Mudd
    Jun 5, 2004
  5. how does CPython work?

    , May 26, 2004, in forum: Python
    Replies:
    3
    Views:
    531
    Stefan Seefeld
    May 27, 2004
  6. Wolfgang Keller

    JMS for CPython via JPype?

    Wolfgang Keller, Nov 2, 2004, in forum: Python
    Replies:
    7
    Views:
    1,498
    Steve Menard
    Nov 6, 2004
  7. Jim Hargrave

    embedding jython in CPython...

    Jim Hargrave, Jan 22, 2005, in forum: Python
    Replies:
    8
    Views:
    743
    Steve Menard
    Jan 24, 2005
  8. Carl Waldbieser
    Replies:
    1
    Views:
    689
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Nov 24, 2005
Loading...