Re: Jython buffer protocol

Jeff Allen <[email protected]>
Newsgroups gmane.comp.lang.jython.devel
Message-ID <[email protected]>
Stefan:

I've added a method to get a ByteBuffer and one for testing the presence 
of array access. I've implemented this in the base classes we use to add 
buffers, and I've used it in core objects where previously I used 
PyBuffer.Pointer.

Rather than push this to the project repository immediately, I've put it 
here for comment:
https://bitbucket.org/tournesol/jython-ja/commits/330839dc597a4ba3cb8168e8bd859ad91b9f4dec

I think BaseBuffer needs refactoring now to separate the layer that 
assumes a real backing array from a base that doesn't. For now I'm 
minimising the changes.

I've never really settled in my mind how I should deal with arrays of 
types other than byte. I keep looking at ByteBuffer.getInt() etc. and at 
IntBuffer, thinking those should be some sort of model. Looking at how 
PyArray works, it almost seems that also should be based on the 
sub-classes of java.nio.Buffer. I think a proper, typed solution would 
make the itemsize property unnecessary. Do you have any thoughts about 
itemsize and non-byte data?

Jeff Allen

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk

_______________________________________________
Jython-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jython-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.