mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Issue #1766304: The range.__contains__ optimization should only be
applied to ints, not to instances of subclasses of int.
This commit is contained in:
parent
067b38eed4
commit
418f81d9b6
2 changed files with 7 additions and 1 deletions
|
|
@ -275,7 +275,7 @@ range_reduce(rangeobject *r, PyObject *args)
|
|||
|
||||
static int
|
||||
range_contains(rangeobject *r, PyObject *ob) {
|
||||
if (PyLong_Check(ob)) {
|
||||
if (PyLong_CheckExact(ob) || PyBool_Check(ob)) {
|
||||
int cmp1, cmp2, cmp3;
|
||||
PyObject *tmp1 = NULL;
|
||||
PyObject *tmp2 = NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue