mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
Improve previous checkin to use a slot check instead of equivalent
attribute name lookup.
This commit is contained in:
parent
e2eda606a8
commit
ed9192e2ae
1 changed files with 2 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue