Commit ed9192e2 authored by Raymond Hettinger's avatar Raymond Hettinger

Improve previous checkin to use a slot check instead of equivalent

attribute name lookup.
parent e2eda606
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment