Eric Snow added the comment:
Would it be okay to do a check on __index__ after the PyLong_Check() succeeds?
Something like this:
if (PyLong_Check(item) &&
item->ob_type->tp_as_number->nb_index ==
PyLong_Type.tp_as_number->nb_index) {
Py_INCREF(item);
return item;
}
This is something Nick and I were talking about at the sprints regarding fast
paths in the abstract API (for mappings and sequences in our case).
----------
nosy: +eric.snow
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue17576>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com