1891
Comment:
|
1896
|
Deletions are marked like this. | Additions are marked like this. |
Line 13: | Line 13: |
The table below contains modules implemented in C in Python that are missing in Jython. Feel free to grab one of them and get started. If none of them catch your fancy, run dist/Lib/regrtest.py. All of the skipped tests are for modules that are present in CPython but not in Jython, so they're fair game too. | The table below contains modules implemented in C in Python that are missing in Jython. Feel free to grab one of them and get started. If none of them catch your fancy, run dist/Lib/test/regrtest.py. All of the skipped tests are for modules that are present in CPython but not in Jython, so they're fair game too. |
CharlieGroves, incept: 2006-11-16
Porting an existing Python module written in C into Java that Jython understands is a pretty straightforward task so it can serve as a good introduction to the Jython codebase. I'm going to explain how to go about porting the [http://www.python.org/doc/2.3.5/lib/module-csv.html csv] module here.
- Declare your intention to implement the csv module on the Jython dev list so no one else starts working on it.
- Add a new class org.python.modules._csv.java in src.
- Add "_csv" to the builtinModules array in org.python.modules.Setup
- Run dist/Lib/test/test_csv.py. Everything will fail since none of the csv methods are implemented yet. Now pick one of the simpler tests and start adding methods to csv to get it to work. _csv.java will be an implementation of the stuff in _csv.c from Python. All of csv_methods from _csv.c needs to be implemented as static methods in _csv.java. You can get an idea of how it's done from _codecs.java and _codecs.c or any of the module implementations in org.python.modules and their corresponding C implementation. As you add the methods to _csv.java, Jython will pick up on them and parts of the tests will start working.
- Keep adding pieces to _csv.java till the tests pass
Submit a patch to the [http://www.jython.org/patches tracker].
- Revel in the glory of another implemented module
The table below contains modules implemented in C in Python that are missing in Jython. Feel free to grab one of them and get started. If none of them catch your fancy, run dist/Lib/test/regrtest.py. All of the skipped tests are for modules that are present in CPython but not in Jython, so they're fair game too.
Module |
Difficulty |
Desirability |
cmath |
** |
*** |
csv |
** |
** |
itertools |
*** |
*** |
math |
** |
*** |
select |
**** |
**** |
unicodedata |
*** |
**** |