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.

作者 petri.lehtinen
收信人 docs@python, eli.bendersky, ncoghlan, petri.lehtinen, pitrou, py.user, r.david.murray, rhettinger, terry.reedy, vstinner
日期 2011-07-25.19:50:14
SpamBayes Score 3.903438e-06
Marked as misclassified
Message-id <1311623415.39.0.733166391662.issue12380@psf.upfronthosting.co.za>
In-reply-to
内容
> The solution could be global, to allow bytearray fit the 'c' format of
> PyArg_ParseTuple. Then one would also be able to pass a bytearray into
> other stringlib methods requiring the 'c' format.

Another possibility would be the change the 'c' format so that it accepts any object that supports the buffer protocol and whose buffer length is 1.

Attaching two patches: The first allows bytes and bytearray, the second allows any object that supports the buffer protocol.
历史
日期 用户 动作 参数
2011-07-25 19:50:15petri.lehtinen修改recipients: + petri.lehtinen, rhettinger, terry.reedy, ncoghlan, pitrou, vstinner, r.david.murray, eli.bendersky, docs@python, py.user
2011-07-25 19:50:15petri.lehtinen修改messageid: <1311623415.39.0.733166391662.issue12380@psf.upfronthosting.co.za>
2011-07-25 19:50:14petri.lehtinen链接issue12380 messages
2011-07-25 19:50:14petri.lehtinen创建