[ctypes-users] Re: copying/slicing ctypes arrays, (c_ulong *n)()
Brought to you by:
theller
From: Florian S. <flo...@gm...> - 2004-12-22 20:55:26
|
On Tue, 21 Dec 2004 19:50:24 +0100, Thomas Heller <th...@py...> wrote: > I have thought about all this a little bit, and it seems that it would > be very useful to accept Python objects which implement the buffer > interface as function parameters (currently only ctype instances, > strings and integers are allowed). > > Of course, sometimes you don't want the data to be copied just at the > beginning, but in this case you should wrap the object into a buffer > object (with the buildin buffer() type/function). The buffer() call > accepts optional parameters for offset and size, so address arithmetic > would be done by the buffer object itself - nicer than to add more > parameters to the memmove function and friends. > > How does that sound? Sounds good. I wonder what the python developers plan to do with buffer in the future, I read it's deprecated and should be redone. Regards, Florian Schulze |