mirror of https://github.com/python/cpython
Improve previous checkin to use a slot check instead of equivalent
attribute name lookup.
This commit is contained in:
parent
e2eda606a8
commit
ed9192e2ae
|
@ -1607,7 +1607,8 @@ PyMapping_Check(PyObject *o)
|
|||
|
||||
return o && o->ob_type->tp_as_mapping &&
|
||||
o->ob_type->tp_as_mapping->mp_subscript &&
|
||||
!PyObject_HasAttrString(o, "__getslice__");
|
||||
!(o->ob_type->tp_as_sequence &&
|
||||
o->ob_type->tp_as_sequence->sq_slice);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
Loading…
Reference in New Issue