[issue21177] ValueError: byte must be in range(0, 256)

STINNER Victor report at bugs.python.org
Tue Apr 8 10:57:00 CEST 2014


STINNER Victor added the comment:

256 is not part of the range(0, 256): 0..255.

$ python
>>> print(list(range(0,256)))
[0, 1, 2, 3, ..., 253, 254, 255]

It doesn't make sense to store the number 256 in a byte string.

----------
nosy: +haypo

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


More information about the Python-bugs-list mailing list