New submission from Xiang Zhang:

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)".

----------
files: _Py_bytes_contains.patch
keywords: patch
messages: 270058
nosy: serhiy.storchaka, xiang.zhang
priority: normal
severity: normal
status: open
title: Unify exception in _Py_bytes_contains for integers
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file43668/_Py_bytes_contains.patch

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

Reply via email to