akira added the comment: "byte must be in range [0, 256)"
- it hints at the builtin `range()` -- the intuition works for those who knows what `range()` does - it uses the standard math notation for half-open intervals [1] -- no Python knowledge required (among other things) - it is not a valid Python -- no confusion with a list, tuple literals - Dijkstra explains why half-open intervals are preferable [2] Another alternative is to use `range(0x100)` and require that to understand the error message, you should know Python and the hex notation. [1]: http://en.wikipedia.org/wiki/Interval_(mathematics)#Notations_for_intervals [2]: http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html ---------- nosy: +akira _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21177> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com