[Python-ideas] set.add could return True or False
anacrolix at gmail.com
Fri Mar 16 13:45:48 CET 2012
This, and more so removing duplication, are my reasons for suggesting it. A
lot of my code uses assertions to verify assumptions about uniqueness of
elements. This requires checking that an element isn't already present
before adding it.
Doing these checks on sets shared by threads requires locking, which is a
high cost when most operations allow "cheating" with the GIL. But this is a
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas