benjaminp / six

Python 2 and 3 compatibility library
https://six.readthedocs.io/
MIT License
991 stars 274 forks source link

six.iterbytes name collision with (deferred) PEP 0467 #334

Open graingert opened 4 years ago

graingert commented 4 years ago

There's a proposal (PEP 0467) to add a bytes.iterbytes method, that currently does the opposite of six.iterbytes

>>> tuple(b"ABC".iterbytes())
(b'A', b'B', b'C')
>>> tuple(six.iterbytes(b"ABC"))
(65, 66, 67)

in an ideal world I'd like to see:

>>> tuple(six.iterbytes(b"ABC"))
(b'A', b'B', b'C')
>>> tuple(six.iterords(b"ABC"))
(65, 66, 67)

but that would require a major version change, as it's changing the existing six.iterbytes function

graingert commented 4 years ago

/cc @ncoghlan @ethanfurman