Re: [Python-Dev] slightly inconsistent set/list pop behaviour

2009-04-07 Thread John Barham
Tennessee Leeuwenburg wrote: > Now, I know that sets aren't ordered, but... > > foo = set([1,2,3,4,5]) > bar = [1,2,3,4,5] > > foo.pop() will reliably return 1 > while bar.pop() will return 5 > > discuss :) As designed. If you play around a bit it becomes clear that what set.pop() returns is inde

Re: [Python-Dev] Syntax suggestion for imports

2008-01-02 Thread John Barham
Raymond Hettinger wrote: > How about a new, simpler syntax: > > * import threading or dummy_threading as threading > * import xml.etree.CElementTree or cElementTree or elementree.ElementTree as > ET > * from cStringIO or StringIO import StringIO These all look good to me. The "short circuit" im