[issue30061] Check if PyObject_Size() raised an error

Serhiy Storchaka report at bugs.python.org
Fri Apr 14 03:36:29 EDT 2017


Serhiy Storchaka added the comment:

Raymond, could you please look at the change in Objects/setobject.c? It makes the code slightly faster (by avoiding few function calls: PyObject_Size(), PySequence_Size()/PyMapping_Size() and sq_length/mp_length), but the main purpose is making clear that no error check is needed after calling PyObject_Size(). I'm not going to include this change in backports.

Xiang suggests larger change that allows to gets rid of one PyDict_CheckExact(). What do you prefer?

----------
nosy: +rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30061>
_______________________________________


More information about the Python-bugs-list mailing list