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 vstinner
Recipients loewis, ocean-city, vstinner
Date 2009-03-17.20:55:55
SpamBayes Score 1.63141e-07
Marked as misclassified No
Message-id <>
> How does that answer the question? We know what data type to 
> use for multiple bytes - but what data type should be used 
> for a single byte?

Hum, what was the question? :-) Quote of my email:

« About m.read_byte(), we have two choices:
 (a) Py_BuildValue("b", value) => 0
 (b) Py_BuildValue("y#", &value, 1) => b"\x00"

About m.write_byte(x), we have also two choices:
 (a) PyArg_ParseTuple(args, "b:write_byte", &value): write_byte(0)
 (b) PyArg_ParseTuple(args, "y#:write_byte", &value, &length) and
     check for length=1: write_byte(b"\x00")

(b) choices are close to Python 2.x API. But we can already use>b"\x00" and m.write(b"\x00") to use byte string of 1 byte. 
So it would be better to break the API and use integers, (a) choices 
(...) »

Oh, I though that the question was about bytes vs str :-/ Ocean-city 
and I prefer the solution (a). And you Martin?
Date User Action Args
2009-03-17 20:56:00vstinnersetrecipients: + vstinner, loewis, ocean-city
2009-03-17 20:55:59vstinnersetmessageid: <>
2009-03-17 20:55:57vstinnerlinkissue5391 messages
2009-03-17 20:55:55vstinnercreate