Are CPython, IronPython, Jython scripts compatible with each other?

I'm sure python scripts will work in all three, but I want to make sure. I read here and there about the editors who can write CPython, Jython, IronPython, and I hope that I differ very much in this difference.

In my situation, there are 3 different api that I want to check. Each api executes the same functionality code, but they are different in implementation. I write wrappers around every apis language. Each shell should reveal the same functionality and implementation for python using Boost :: python, Jython and IronPython.

My question is, will a python script written using these public methods (common to each language) work in all three Python “flavors”?

As I said, I’m sure the answer is “Of course,” but I need to make sure before I spend too much time on this.

+7
python jython ironpython testing boost-python
source share
1 answer

Short answer: Sometimes.

Some projects built on top of IronPython may not work with CPython, and some CPython modules written in C (such as NumPy) will not work with IronPython.

At the same time, when Jython implements the language specification, it has several incompatibilities with CPython (for example, it lacks several parts of the standard CPython library and can import standard packages and classes of the standard Java library such as Swing)

So yes, if you avoid incompatibility.

+10
source share

All Articles