Search code examples
pythondistributioncpythonpypy

when to use an alternative Python distribution?


I have been programming in Python for a few years now and have always used CPython without thinking about it. The books and documentation I have read always refer to CPython too.

When does it make sense to use an alternative distribution (PyPy, Stackless, etc)?

Thanks!


Solution

  • If you need native interfacing with the JVM, use Jython.

    When you need native interfacing with the .Net platform, or want to use Winforms, use IronPython.

    If you need the latest version, cross-OS support, make use of existing C-based modules existing only for CPython, the use it.

    If you are thinking into proposing a functional PEP, going the Pypy route could be useful.

    If you need to do something that Python makes hard (i.e. microthreading), you could go the Stackless way, or any other language (Haskel, etc.).


    The alternative implementations are always behind CPython, most now target 2.5.

    Both Jython and IronPython are good ways to sneak in Python into MS-only or Java-only shops, generally through their use for unittests.