On Sun, Sep 4, 2016 at 1:23 AM, Ivan Levkivskyi <levkivs...@gmail.com> wrote: > On 4 September 2016 at 00:11, Random832 <random...@fastmail.com> wrote: >> >> On Sat, Sep 3, 2016, at 18:06, Koos Zevenhoven wrote: >> > I guess one reason I don't like bchr (nor chrb, really) is that they >> > look just like a random sequence of letters in builtins, but not >> > recognizable the way asdf would be. >> > >> > I guess I have one last pair of suggestions for the name of this >> > function: bytes.chr or bytes.char. >> >> What about byte? Like, not bytes.byte, just builtins.byte. > > > I like this option, it would be very "symmetric" to have, compare: > >>>>chr(42) > '*' >>>>str() > '' > > with this: > >>>>byte(42) > b'*' >>>>bytes() > b'' > > It is easy to explain and remember this.
In one way, I like it, but on the other hand, indexing a bytes gives an integer, so maybe a 'byte' is just an integer in range(256). Also, having both byte and bytes would be a slight annoyance with autocomplete. -- Koos _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com