[Python-Dev] slightly inconsistent set/list pop behaviour (original) (raw)
Raymond Hettinger python at rcn.com
Wed Apr 8 07:47:45 CEST 2009
- Previous message: [Python-Dev] slightly inconsistent set/list pop behaviour
- Next message: [Python-Dev] slightly inconsistent set/list pop behaviour
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
[Tennessee Leeuwenburg ]
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 :)
If that's what you need: http://code.activestate.com/recipes/576694/
Raymond
- Previous message: [Python-Dev] slightly inconsistent set/list pop behaviour
- Next message: [Python-Dev] slightly inconsistent set/list pop behaviour
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]