From ed9192e2ae144706f6ecb9bdfb903220e2d33845 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Mon, 5 Apr 2004 08:14:48 +0000 Subject: Improve previous checkin to use a slot check instead of equivalent attribute name lookup. --- Objects/abstract.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Objects/abstract.c b/Objects/abstract.c index 307ef86..f586d6d 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 -- cgit v0.12