[issue2415] bytes() should respect __bytes__

Benjamin Peterson report at bugs.python.org
Wed Mar 19 16:32:56 CET 2008


Benjamin Peterson <musiccomposition at gmail.com> added the comment:

I took a quick glance at this. It hinges on how the C-API is going to
look. Currently, bytes is known in C as PyString and gets it's
representation from __str__. Although we could just change it to
__bytes__, Christian has said that he is going to rename it to PyBytes
(and what is now PyBytes -> PyByteArray). [1] Further muddying the
waters is the fact that PyObject_Str generates the unicode
representation of an object and should really be called PyObject_Unicode.

[1] http://mail.python.org/pipermail/python-3000/2008-March/012477.html

----------
nosy: +benjamin.peterson, tiran

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2415>
__________________________________


More information about the Python-bugs-list mailing list