[Python-ideas] Fixing the Python 3 bytes constructor

Serhiy Storchaka storchaka at gmail.com
Thu Apr 3 21:03:19 CEST 2014


02.04.14 14:40, Nick Coghlan написав(ла):
> I thought of that, but it seems like a recipe for typos and confusion.
> bytes.byte and bytearray.byte seem clearer and safer.

bytearray.byte looks deceptive. It returns not a byte, but 1-element 
bytearray.

I doubt that creating 1-element bytearray is enough often case to add 
new special method (unlike to bytes.byte).



More information about the Python-ideas mailing list