Although 2.7 has the new buffer interface and memoryview objects, these are 
widely not accepted in the built in modules.
Examples are the structmodule, some of the socketmodule apis, structmodule, etc.

IMHO this is unfortunate.  For example when doign network io, you would want 
code like this:
Buffer = bytearray(10)
Socket.recv_into(Buffer)
Header = struct.unpack("i", memoryview(Buffer)[:4])[0]

In other words, you want to minimize coping the data around.  Currently in 2.7 
you have to cast the memoryview to str() which copies the data.  In 3.0 you 
don't.
Is there any chance of getting changes like these in ?
(swapping s# for s* in PyArg_ParseTuple in a few strategic places)

My current list of places would be:
_strucmodule.c
arraymodule.c
zlibmodule.c
marshal.c

audioop.c and imageop.c are probably less important.
K
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to