Message94508
Sometimes, a non-removing pop() is needed. In current Python versions,
it can achieved by one of the following ways:
1.
x = some_set.pop()
some_set.add(x)
2.
for x in some_set:
break
3.
x = iter(some_set).next()
More native and clean would, however, be
some_set.get()
The attached patch does this for set(). If this is accepted by the
community, frozenset should be extended as well. |
|
Date |
User |
Action |
Args |
2009-10-26 21:07:19 | wrichert | set | recipients:
+ wrichert |
2009-10-26 21:07:19 | wrichert | set | messageid: <1256591239.7.0.409642892772.issue7212@psf.upfronthosting.co.za> |
2009-10-26 21:07:18 | wrichert | link | issue7212 messages |
2009-10-26 21:07:18 | wrichert | create | |
|