[PYTHON MATRIX-SIG] Re: Saving HUGE arrays

VIENNET Emmanuel 48.06.27.97 Equipe Gallinari Emmanuel.Viennet@laforia.ibp.fr
Thu, 21 Nov 1996 12:00:17 +0100


> I would presume the interface could be something like
> 
> int PyBuffer_GetInfo(object *o, const char **address, int *length);
> 
> to get the address and size of a "buffer" object into a C char pointer
> (or should that be void???) and length.  The return value would be -1
> if the object was not "bufferable".  I guess a PyBuffer_Check(o) call
> should also be available.  For *mutable* buffer objects, a version
> that returns a non-const pointer could be provided (but for strings
> this would fail) so one could read data *into* a buffer object.

Cool. This would allow very efficient implementation of matrix I/O
packages.

I presume PyBuffer_GetInfo() should fail on non-contiguous arrays ?


PyBuffer_GetInfo() must check if the buffer is available read-only
(immutable objects) or read/write (mutable, e.g. contiguous arrays).

We could add it a mode argument, ala fopen() ('r', 'w').

Emmanuel
-- 
Emmanuel Viennet: <viennet@ura1507.univ-paris13.fr>
LIPN - Institut Galilee - Universite Paris-Nord       
93430 Villetaneuse -  France

=================
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
=================