[issue8838] Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

Antoine Pitrou report at bugs.python.org
Fri May 28 14:19:21 CEST 2010


Antoine Pitrou <pitrou at free.fr> added the comment:

> Any Python object can expose a buffer interface and the above
> functions then allow accessing these interfaces from within
> Python.

What's the point? The codecs functions already support objects exposing the buffer interface:

>>> b = b"\xe9"
>>> codecs.latin_1_decode(memoryview(b))
('é', 1)
>>> codecs.latin_1_decode(array.array("b", b))
('é', 1)

Those two functions are undocumented. They serve no useful purpose (you can call the bytes(...) constructor instead, or even use the buffer object directly as showed above). They are badly named since they don't have anything to do with codecs. Google Code Search shows them not appearing anywhere else than implementations of the Python stdlib. Removing them only seems reasonable.

----------
nosy: +loewis, pitrou

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8838>
_______________________________________


More information about the Python-bugs-list mailing list