[issue27572] Support bytes-like objects when base is given to int()

Serhiy Storchaka report at bugs.python.org
Fri Jul 22 11:32:02 EDT 2016


Serhiy Storchaka added the comment:

It looks to me that the support of bytes-like objects besides bytes and bytearray was added accidentally, as a side effect of supporting Unicode. Note, that this support had a bug until issue24802, thus correct support of other bytes-like objects exists less than a year. The option of deprecating other bytes-like objects support looks reasonable to me. Especially in the light of deprecating bytearray paths support (issue26800).

On other side, the need of copying a buffer can be considered as implementation detail, since low-level int parsing functions require NUL-terminated C strings. We can add alternative low-level functions that work with not-NUL-terminated strings. This needs more work.

----------
nosy: +serhiy.storchaka

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


More information about the Python-bugs-list mailing list