This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients catlee, davide.rizzo, eric.araujo, georg.brandl, jhylton, orsenthil, pitrou, rcoyner, rhettinger, xuanji
Date 2010-11-30.16:07:31
SpamBayes Score 1.0420875e-06
Marked as misclassified No
Message-id <1291133257.53.0.702262751372.issue3243@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2010-11-30 16:07:37pitrousetrecipients: + pitrou, jhylton, georg.brandl, rhettinger, orsenthil, catlee, eric.araujo, rcoyner, xuanji, davide.rizzo
2010-11-30 16:07:37pitrousetmessageid: <1291133257.53.0.702262751372.issue3243@psf.upfronthosting.co.za>
2010-11-30 16:07:31pitroulinkissue3243 messages
2010-11-30 16:07:31pitroucreate