Steven D'Aprano, 18.01.2014 02:27: > On Fri, Jan 17, 2014 at 08:49:21AM -0800, Ethan Furman wrote: >> %s is restricted in what it will accept:: >> >> - input type supports Py_buffer? >> use it to collect the necessary bytes > > Can you give some examples of what types support Py_buffer? Presumably > bytes. Anything else?
Lots of things: bytes, bytearray, memoryview, array.array, NumPy arrays, just to name a few. Basically anything that wants itself to be representable as a chunk of memory with metadata. It's a very common thing in the Big Data department (although many people wouldn't know that they're actually heavy users of this protocol because they just use NumPy and/or Cython and don't look under the hood). Stefan _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com