Petri Lehtinen <pe...@digip.org> added the comment:

> 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.

----------
keywords: +patch
Added file: http://bugs.python.org/file22756/c_format_bytearray.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12380>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to