1

Frank Wierzbicki in his blog post has written "Jython 2.7b3 brings us up to language level compatibility with the 2.7 version of CPython."

Does it mean that any CPython 2.7 code would work with Jython?

I have a large code written in CPython 2.7. Since we want to integrate it with JAVA modules, I would be extremely interested in a way of migrating to Jython without rewriting of code. Considering libraries, I use a lot of lxml which (as described here) was not compatible with the previous versions Jython.

1
  • Anything written in pure python should work in Jython. But anything third-party packages with C code will almost certainly not. If lxml has C code, which it seems that it does, then it will probably still not work. Commented Oct 8, 2014 at 16:14

1 Answer 1

3

No, not all code that works in CPython 2.7 will work in Jython, in the same way that some code is tied to a specific OS and won't work on other OS-es (e.g. Windows-specific Python code won't work on Linux, and vice versa).

The syntax will work, but if the script requires specific add-on modules such as lxml, then those will not work. That is because lxml is a C-API extension, and Jython doesn't support the Python C-API.

Similarly, if your code uses the multiprocessing module, then it also won't work on Jython, because that part of the standard library is not included.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.