[issue6687] Move the special-case for integer objects out of PyBytes_FromObject.

2009-12-30 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: Committed in r77174. Thank you for reviewing! -- resolution: -> accepted stage: patch review -> committed/rejected status: open -> closed ___ Python tracker

[issue6687] Move the special-case for integer objects out of PyBytes_FromObject.

2009-12-11 Thread Mark Dickinson
Mark Dickinson added the comment: > What C function are you referring to? A currently non-existent one! I was wondering whether the current bytes- from-integer functionality that PyBytes_FromObject supplies is important enough to preserve somehow. I'd guess not. --

[issue6687] Move the special-case for integer objects out of PyBytes_FromObject.

2009-12-11 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: Mark Dickinson wrote: > Is there still a need for a separate C function for creating a zero- > initialized bytes object from a Py_ssize_t or a Python integer? What C function are you referring to? > And this check doesn't cover other, similar, cases: for

[issue6687] Move the special-case for integer objects out of PyBytes_FromObject.

2009-08-14 Thread Mark Dickinson
Mark Dickinson added the comment: +1 from me too; I agree the current API of PyBytes_FromObject is ugly. Is there still a need for a separate C function for creating a zero- initialized bytes object from a Py_ssize_t or a Python integer? It's a fairly simple operation (PyBytes_FromStringAn

[issue6687] Move the special-case for integer objects out of PyBytes_FromObject.

2009-08-11 Thread Benjamin Peterson
Benjamin Peterson added the comment: +1 -- nosy: +benjamin.peterson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue6687] Move the special-case for integer objects out of PyBytes_FromObject.

2009-08-11 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: Oh, in case you wonder, the added PyUnicode_Check(x) check is to force PyBytes_FromObject to raise an error when given an empty unicode string (I will this as a comment in my patch). -- ___ Python tracker

[issue6687] Move the special-case for integer objects out of PyBytes_FromObject.

2009-08-11 Thread Alexandre Vassalotti
New submission from Alexandre Vassalotti : The documentation for PyBytes_FromObject states: .. cfunction:: PyObject* PyBytes_FromObject(PyObject *o) Return the bytes representation of object *o* that implements the buffer protocol. However, there exists a special-case for integer object