Message94508
| Author | wrichert |
|---|---|
| Recipients | wrichert |
| Date | 2009-10-26.21:07:17 |
| SpamBayes Score | 3.286525e-06 |
| Marked as misclassified | No |
| Message-id | <1256591239.7.0.409642892772.issue7212@psf.upfronthosting.co.za> |
| In-reply-to |
| Content | |
|---|---|
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. |
|
| History | |||
|---|---|---|---|
| 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 | |