Jack Jansen wrote: > > Why not pass the index to the As*Buffer routines as well and make getsegcount > available too? Then you could code things like > for(i=0; i<PyObject_GetBufferCount(obj); i++) { > if ( PyObject_AsCharBuffer(obj, &buf, &count, i) < 0 ) > return -1; > write(fp, buf, count); > } Well, just like Greg said, this is not much different than using the buffer interface directly. While the above would be a handy PyObject_WriteAsBuffer() kind of helper, I don't think that this is really used all that much. E.g. in mxODBC I use the APIs for accessing the raw char data in a buffer: the pointer is passed directly to the ODBC APIs without copying, which makes things quite fast. IMHO, this is the greatest advantage of the buffer interface. -- Marc-Andre Lemburg ______________________________________________________________________ Y2000: 150 days left Business: http://www.lemburg.com/ Python Pages: http://www.lemburg.com/python/
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4