This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ezio.melotti
Recipients eric.araujo, ezio.melotti, jcea, max-alleged, petri.lehtinen, rhettinger, terry.reedy, xuanji
Date 2011-07-24.02:05:04
SpamBayes Score 3.0980277e-06
Marked as misclassified No
Message-id <>
> 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.
Date User Action Args
2011-07-24 02:05:05ezio.melottisetrecipients: + ezio.melotti, rhettinger, terry.reedy, jcea, eric.araujo, xuanji, max-alleged, petri.lehtinen
2011-07-24 02:05:05ezio.melottisetmessageid: <>
2011-07-24 02:05:04ezio.melottilinkissue12170 messages
2011-07-24 02:05:04ezio.melotticreate