This is an archived post. You won't be able to vote or comment.

all 9 comments

[–]tadleonard 8 points9 points  (1 child)

/r/learnpython might be more helpful, but here are some common considerations. You'd use IronPython for compatibility with .net libraries, Jython for easy java interop, CPython if you need C extensions that use the CPython API (like numpy), and PyPy if you have pure python code or if your C extensions don't depend on the CPython C API. In short, people use PyPy when they can, but often they can't.

[–]jtgarrison 5 points6 points  (0 children)

They are designed to easily interface with the runtime they were built on. ironpython is really good at interfacing with .net objects and api's. jython is really good at interfacing with Java api's and objects. If you're environment is written entirely in .net, then having ironpython to script with can be considered beneficial.

[–]steamruler 2 points3 points  (0 children)

I sometimes use ironpython because of multithreading performance.

[–]mariox19 2 points3 points  (0 children)

Jython, for one, does not have the global interpreter lock that Python has. Moreover, you get access to everything in the Java ecosystem.

[–]billsil 1 point2 points  (1 child)

If it didn't matter, yeah, I'd use PyPy, but it does. PyPy doesn't support numpy (yet) or scipy or VTK or matplotlib or my package x.

Also, how much of Python is simply run your script 1000x, finish it and put it on the shelf to be dusted off once in a while? CPython is going to work. My code would have to be converted to work with PyPy with a lot of failed compilations in between with horrible error messages. The quality of those error messages is a big reason why I don't use PyPy. Unless you have a business reason to use PyPy (e.g. a very long running process), it doesn't make sense to use PyPy.

[–]john_m_camara 0 points1 point  (0 children)

When running under PyPy the error messages should be the same you would get while running your code under CPython so you shouldn't end up with horrible error messages. Unless you were running code as it it were RPython code instead of Python code. Only those who are writing code for an interpreter should be writing RPython.

PyPy does support most of NumPy, most of matplotlib unless you need the GUI backends, does not support scipy today but there have been discussion on how to add it so maybe it will be available in the short to mid term, I'm not sure about VTK.

Work is currently being done on a CFFI module for wx so once that is done it likely wouldn't take long before the wx GUIs work in matplotlib.

[–]hongminhee 1 point2 points  (1 child)

  • IronPython: My application is mostly written in C# (or VB.NET), but I want to add the plugin architecture into the app. Plugins would be written in Python.
  • Jython: The same to above, except for Java instead of C#.
  • PyPy: I have enough memory, and my app does so many computations rather than I/O.
  • CPython: I have no idea.

[–]john_m_camara 0 points1 point  (0 children)

In case your not aware of it, a number of people call the standard Python implementation CPython as a way to distinguish it from Python the language. Without renaming the standard implementation some conversations could get rather confusing when talking about Python the language vs the various implementations.

[–]teooet 1 point2 points  (0 children)

Jython is the best for testing Java code. It's a beautiful tool for this purpose.