[Python-3000] PyBytes_FromObject

Brett Cannon brett at python.org
Sat Jun 28 20:30:31 CEST 2008


On Sat, Jun 28, 2008 at 8:33 AM, Guido van Rossum <guido at python.org> wrote:
> Seems to make sense. Do you see many places where it would make
> existing code shorter?
>

If it could be used to get the bytes from a file object, then
marshal.c could use it; the code calls the "read" method on file
objects and then has to check if it got a bytearray or bytes instance
in order to get the raw string to do its work. Otherwise the
conversion to bytes would help by eliminating the separate bytearray
check.

-Brett

> On Sat, Jun 28, 2008 at 6:46 AM, Benjamin Peterson
> <musiccomposition at gmail.com> wrote:
>> It seems PyBytes is missing the parallel call for
>> PyByteArray_FromObject. Should I add it?
>
> --
> --Guido van Rossum (home page: http://www.python.org/~guido/)
> _______________________________________________
> Python-3000 mailing list
> Python-3000 at python.org
> http://mail.python.org/mailman/listinfo/python-3000
> Unsubscribe: http://mail.python.org/mailman/options/python-3000/brett%40python.org
>


More information about the Python-3000 mailing list