This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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:19wrichertsetrecipients: + wrichert
2009-10-26 21:07:19wrichertsetmessageid: <1256591239.7.0.409642892772.issue7212@psf.upfronthosting.co.za>
2009-10-26 21:07:18wrichertlinkissue7212 messages
2009-10-26 21:07:18wrichertcreate