Josiah Carlson wrote:
> At least for the examples of buffers that I've seen, using the buffer
> interface for objects that support it is equivalent to automatically
> applying str() to them. This is, strictly speaking, an optimization.
>>> a = array.array("i", [1, 2, 3])
>>> str(a)
"array('i', [1, 2, 3])"
>>> str(buffer(a))
'\x01\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00'
</F>
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com