Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 245
hoju Avatar asked Oct 23 '09 00:10

hoju


1 Answers

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.

like image 184
Esteban Küber Avatar answered Oct 27 '22 01:10

Esteban Küber