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.

Title: Unify exception in _Py_bytes_contains for integers
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.6
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: python-dev, serhiy.storchaka, xiang.zhang
Priority: normal Keywords: patch

Created on 2016-07-09 17:42 by xiang.zhang, last changed 2022-04-11 14:58 by admin. This issue is now closed.

File name Uploaded Description Edit
_Py_bytes_contains.patch xiang.zhang, 2016-07-09 17:42 review
Messages (3)
msg270058 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2016-07-09 17:42
Now, `sys.maxsize+1 in b'foo'` raises "TypeError: 'int' does not support the buffer interface" which seems weird. In such case, I don't think there is any difference between sys.maxsize+1 and 256. So I suggest make it emits the same exceptions as `256 in b'foo'`, "ValueError: byte must be in range(0, 256)".
msg270065 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-07-09 20:09
msg270078 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-07-10 09:38
New changeset 93ab72de7431 by Serhiy Storchaka in branch 'default':
Issue #27474: Unified error messages in the __contains__ method of bytes and
Date User Action Args
2022-04-11 14:58:33adminsetgithub: 71661
2016-07-10 09:39:24serhiy.storchakasetstatus: open -> closed
resolution: fixed
components: + Interpreter Core
stage: commit review -> resolved
2016-07-10 09:38:30python-devsetnosy: + python-dev
messages: + msg270078
2016-07-09 20:09:33serhiy.storchakasetassignee: serhiy.storchaka
messages: + msg270065
stage: commit review
2016-07-09 17:42:39xiang.zhangcreate