Am Freitag, 30. Oktober 2009 03:58:16 schrieb Steven D'Aprano: > To clarify point 3, given: > > x = set.get() > y = set.get() > > then x and y will only be the same element if set has length one. > However, given: > > x = set.get() > set.add(el) > set.remove(el) > y = set.get() > > there are no guarantees about x and y being different. > > I believe that the patch supplied by Willi Richart implemented these > behaviours. > > http://bugs.python.org/issue7212 > Actually, no. The patch makes no assumption about x and y being different. It does not try to extend the core functionality of set nor does it need to maintain any state that would be necessary for that. It is just a more obvious and cleaner way for saying "for x in some_set: break". So, as Raymond says, it is the Pythonic version of "arb" in setl. wr
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4