From: Raymond Hettinger Date: Mon, 5 Apr 2004 08:14:48 +0000 (+0000) Subject: Improve previous checkin to use a slot check instead of equivalent X-Git-Tag: v2.4a1~530 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ed9192e2ae144706f6ecb9bdfb903220e2d33845;p=thirdparty%2FPython%2Fcpython.git Improve previous checkin to use a slot check instead of equivalent attribute name lookup. --- diff --git a/Objects/abstract.c b/Objects/abstract.c index 307ef8650b0d..f586d6d449d2 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -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