[issue24681] Put most likely test first in set_add_entry()

Serhiy Storchaka report at bugs.python.org
Thu Jul 23 10:55:32 CEST 2015


Serhiy Storchaka added the comment:

The condition that is determined by the PyObject_RichCompareBool() check is not that the element is already present, but that the element was present. Even if we will agree that such behavior change is appropriate, the inconsistency with dict makes it doubtful (originally set was implemented with dict).

I have no objections against tweaking so->table caching. I even think this part of the patch improves the code.

----------

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


More information about the Python-bugs-list mailing list