Eric Jonas | 1 Jul 17:02

Proper (2.5 svn) way of writing an extension?

So I'm a bit confused on how to get started here, unfortunately -- the
wiki seems to still be stuck in a pre-2.5 world, so is the best way to
start writing a module (given the current jython svn trunk):

Do I use the annotations as described here: 

http://wiki.python.org/jython/PythonTypesInJava

Or, per http://wiki.python.org/jython/JythonModulesInJava

- write a "POJO" (which I assume means Plain Old Java Object)
- vs a subclass of PyObject (which gives me keyword args, i think)

What is the standard way that jython has been implementing/migrating
existing standard library c modules? What would people recommend? 

Thanks, 
		...Eric

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
Leo Soto M. | 1 Jul 17:19

Re: Proper (2.5 svn) way of writing an extension?

On Tue, Jul 1, 2008 at 11:06 AM, Eric Jonas <jonas <at> mit.edu> wrote:
> So I'm a bit confused on how to get started here, unfortunately -- the
> wiki seems to still be stuck in a pre-2.5 world, so is the best way to
> start writing a module (given the current jython svn trunk):
>
> Do I use the annotations as described here:
>
> http://wiki.python.org/jython/PythonTypesInJava
>
> Or, per http://wiki.python.org/jython/JythonModulesInJava
>
> - write a "POJO" (which I assume means Plain Old Java Object)
> - vs a subclass of PyObject (which gives me keyword args, i think)
>
> What is the standard way that jython has been implementing/migrating
> existing standard library c modules? What would people recommend?

I think that this approach (documented on JythonModulesInJava) is the
easiest way:

"My new approach is borrowed slightly from CPython where it's very
common to write a C library, a straight wrapper and then a Pythonic
wrapper. In Jython, the first two steps are really one so the
development effort is significantly simplified. Writing a wrapper in
Python offers the dual benefits of being easy to maintain and refactor
as well as requiring less development time"

I would use it unless there is a strong reason against it for your
particular case.

(Continue reading)


Gmane