Set & Frozenset?

Alan G Isaac alan.isaac at gmail.com
Mon Mar 9 12:54:31 EDT 2009


> Hans Larsen schrieb:
>>             How could I "take" an elemment from a set or a frozenset 


On 3/8/2009 2:06 PM Diez B. Roggisch apparently wrote:
> You iterate over them. If you only want one value, use
> iter(the_set).next()


I recall a claim that

	for result in myset: break

is the most efficient way to get one result.
Is this right? (It seems nearly the same.)

Alan Isaac



More information about the Python-list mailing list