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

Georg Brandl g.brandl at gmx.net
Tue Oct 27 17:06:44 CET 2009


Chris Bergstresser schrieb:

>    I like the proposed set.get() method, personally.  list.get(index)
> gets the item at that index, dict.get(key) gets the item associated
> with that key, set.get() gets an item, but doesn't place any
> guarantees on which item is returned.

Sorry to nitpick, but there is no list.get().

Georg


-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.



More information about the Python-Dev mailing list