[Python-Dev] buffer object

Guido van Rossum guido@python.org
Mon, 08 May 2000 15:55:50 -0400


> >I don't recall why JPython has jarray instead of array -- how do they
> >differ?  I think it's a shame that similar functionality is embodied
> >in different APIs.
> 
> The jarray module is a paper thin factory for the PyArray type which is
> primary (I believe) a wrapper around any existing java array instance.
> It exists to make arrays returned from java code useful for jpython.
> Since a PyArray must always wrap the original java array, it cannot
> resize the array.

Understood.  This is a bit like the buffer API in CPython then (except
for Greg's vision where the buffer object manages storage as well :-).

> In contrast an array instance would own the memory and can resize it as
> necessary.

OK, this makes sense.

> Due to the different purposes I agree with Jim's decision of making the
> two module incompatible. And they are truly incompatible. jarray.array
> have reversed the (typecode, seq) arguments.

This I'm not so sure of.  Why be different just to be different?

> OTOH creating a mostly compatible array module for jpython should not be
> too hard.

OK, when we make array() a built-in, this should be done for Java too.

--Guido van Rossum (home page: http://www.python.org/~guido/)