From: Kent Johnson <kent37@td...> - 2005-04-20 14:01:24
I originally posted this on jython-users in response to yet another question about using C
extensions from Jython. I guess jython-dev is the right place for it. Who maintains the web site? Is
this a good idea?
-------- Original Message --------
Subject: Re: [Jython-users] Compiling jython using python externals modules
Date: Tue, 19 Apr 2005 11:57:20 -0400
From: Kent Johnson <kent37@...>
References: <016401c544a1$ac1d6c40$1a0110ac@...> <200504191621.58646.orantes@...>
This question comes up over and over on this list. Maybe the web site should be changed to
prominently feature the information that
- Jython implements Python 2.1 and is not compatible with more recent language features
- Jython cannot use any Python extensions written in C
I'm not sure where the best place for this might be. I suggest a new section on the main
Documentation page, between "Jython Specific Documentation" and "Interaction with Java Packages".
Here is suggested text (lifted from the Wiki FAQ):
Relationship with Python
Jython is an implementation of the Python language in Java. The latest Jython release (2.1)
implements the same language as CPython 2.1 and many of the CPython standard library modules.
There are two incompatibilities with modern CPython that often trip newcomers. First, Jython 2.1
does not implement any features added to CPython in version 2.2 or later. This includes language
features such as generators and new-style classes, and library modules such as optparse. A more
modern version of Jython is under active development.
Second, Jython programs cannot use CPython extension modules written in C. These modules usually
have files with the extension .pyc, .pyd or .dll. If you want to use such a module, you should look
for an equivalent written in pure Python or Java.
There are a number of other differences between the two implementations that are unlikely to go
away. These range from the trivial - Jython's code objects don't have a co_code attribute because
they don't have any Python bytecodes; to the significant - Jython uses Java's true garbage
collection rather than Python's reference counting scheme. See
http://jython.sourceforge.net/docs/differences.html for details.