Message122911
One way to check that it's bytes-compatible is to take a memoryview of it:
>>> memoryview(b"abc")
<memory at 0x1cf5120>
>>> memoryview(bytearray(b"abc"))
<memory at 0x1cf55a0>
>>> memoryview(array.array('b', b"abc"))
<memory at 0x1cf52a0>
>>> memoryview([b"abc"])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: cannot make memory view because object does not have the buffer interface
>>> memoryview("abc")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: cannot make memory view because object does not have the buffer interface |
|
Date |
User |
Action |
Args |
2010-11-30 16:07:37 | pitrou | set | recipients:
+ pitrou, jhylton, georg.brandl, rhettinger, orsenthil, catlee, eric.araujo, rcoyner, xuanji, davide.rizzo |
2010-11-30 16:07:37 | pitrou | set | messageid: <1291133257.53.0.702262751372.issue3243@psf.upfronthosting.co.za> |
2010-11-30 16:07:31 | pitrou | link | issue3243 messages |
2010-11-30 16:07:31 | pitrou | create | |
|