Improve previous checkin to use a slot check instead of equivalent

attribute name lookup.
This commit is contained in:
Raymond Hettinger 2004-04-05 08:14:48 +00:00
parent e2eda606a8
commit ed9192e2ae

View file

@ -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