Comparison of various Python implementations for
conformance.
Methodology
I started with Mical's
test
cases as they were small micro unit tests.
I removed any test that failed using
CPython 2.3.4. Some
tests were designed to raise an exception, and unhandled exceptions
are likely to vary between implementations.
I ran each test on
pie-thon,
ast2past, and
pirate on the latest
Parrot from CVS on
Debian. I also ran each test on
jython on Java 1.4.2 and
iron-python on .Net 1.1.4322,
both on WindowsXP.
I marked each output as pass if output as compared
to the CPython implementation on the same platform was byte for
byte identical.
I marked each output as pass* if the outputs
differed only in leading or trailing spaces. There were a
fair number of these.
All other outputs were marked as FAIL. Where
possible, I tried to capture stderr.
Click on the links to see the source of the test and the
outputs.
Interesting/impressive that the only tests that Jython fails are the two cases where it's showing it's pre-2.2.1 roots and using 1/0 rather than the later True/False.
Looks like a lot of the piethon converter's failures are pretty simple things--python ops that haven't been implemented but shouldn't be much trouble. (Though whether that masks other problems is another question) I may have to take a poke at it later if I get some time.
En este post, Sam Ruby muestra una comparativa de las distintas implementaciones Python.De lectura muy aconsejable para los interesados en el estado de desarrollo de estas variantes....
I think there must be something wrong with some of your results. I'll pick out one example: I see that Jython is passing the generator test. Yet I'm fairly sure that generators have not been implemented in Jython. So I tried it... and it sure fails for me! Could you explain? (CC me by mail if you would...)
C:\tmp>java -cp c:\jython\jython.jar org.python.util.jython test\generator.py
0 1 done
C:\tmp>java -cp c:\jython\jython.jar org.python.util.jython -v
import: 'exceptions' as org.python.core.exceptions in builtin modules
Jython 2.2a0 on java1.4.2_02 (JIT: null)
import: 'site' as c:\jython\Lib\site$py.class
import: 'sys' as sys in builtin modules
import: 'os' as org.python.modules.os in builtin modules
import: 'javaos' as c:\jython\Lib\javaos$py.class
import: 'java' as java package
import: 'File' as java class
import: 'javapath' as c:\jython\Lib\javapath$py.class
import: 'System' as java class
import: 'UserDict' as c:\jython\Lib\UserDict$py.class
import: 'sitecustomize' not found (=> ImportError)
Type "copyright", "credits" or "license" for more information.
>>>