Comparing Pythons
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
passif 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.
Results
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.
Posted by Gwyn Evans at
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.
Posted by dan at
"the only tests that Jython fails are the two cases where it's showing it's pre-2.2.1 roots"
Make that "pre-2.3".
Jython 2.2 is a 2.2 implementation, and CPython 2.2 also "fails" the boolean tests.
Posted by Fredrik atSam Ruby: Comparing Pythons
Comparison of various Python implementations for conformance....Excerpt from Discreet Blogmarks at
Comparativa entre implementaciones Python
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....Excerpt from PythonHispano - Portal sobre Python para la comunidad hispana - at
FWIW, I patched up some of the errors from pie-thon and put them into CVS. Some things still fail, but fewer of them.
Posted by dan at
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...)
Posted by Michael Chermside at
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. >>>Posted by Sam Ruby at
Links: 20041006
Python Programming FAQ (python) (programming) (faq) Thirty-seven Reasons I Love Ruby (ruby) (programming) Instiki (ruby) (wiki) Practices in Directory Groups (groups) (i2) (ldap) (mace-dir) (middleware) (practices) (paper) Straw man architecture...Excerpt from devclue at
It would have been helpful to include the total pass/fail figures for each implementation.
Posted by Aristotle Pagaltzis at