diff options
author | Raymond Hettinger <python@rcn.com> | 2004-04-05 08:14:48 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2004-04-05 08:14:48 (GMT) |
commit | ed9192e2ae144706f6ecb9bdfb903220e2d33845 (patch) | |
tree | 2e7e34e9cd4035dca4d175e6c7d45d83bcb5becf /Objects | |
parent | e2eda606a83cbe68846faf44b478053e250fb025 (diff) | |
download | cpython-ed9192e2ae144706f6ecb9bdfb903220e2d33845.zip cpython-ed9192e2ae144706f6ecb9bdfb903220e2d33845.tar.gz cpython-ed9192e2ae144706f6ecb9bdfb903220e2d33845.tar.bz2 |
Improve previous checkin to use a slot check instead of equivalent
attribute name lookup.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/abstract.c | 3 |
1 files changed, 2 insertions, 1 deletions
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 |