[Python-Dev] Retrieve an arbitrary element from a set withoutremoving it

A.M. Kuchling amk at amk.ca
Fri Oct 30 21:27:22 CET 2009

On Fri, Oct 30, 2009 at 09:37:36PM +0100, Georg Brandl wrote:
> I don't like this.  It gives a set object a hidden state, something that
> AFAICS no other builtin has.  Iterating over an iterable is what iterators
> are for.

It also makes the object thread-unsafe; there's no way for two threads
to iterate over it at the same time.  It's a terrible idea to
introduce new things that won't work under threaded usage.


More information about the Python-Dev mailing list