Ezio Melotti <ezio.melo...@gmail.com> added the comment:

> When an integer out of range(0, 256) is passed as the first argument,
> should we raise a ValueError or a TypeError?

ValueError = Inappropriate argument value (of correct type).
TypeError = Inappropriate argument type.

> Currently, a ValueError raised, but this may be bad for index and 
> rindex, as they raise a ValueError when the substring or byte is not found.

Then the users should check if the value is in range(256) before passing it to 
(r)index.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12170>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to