Is there a canonical way to check whether an iterable is ordered?

Roy Smith roy at
Fri Sep 19 01:52:28 CEST 2014

In article <mailman.14103.1411047208.18130.python-list at>,
 Chris Angelico <rosuav at> wrote:

> The one thing you can rely on (and therefore must comply with, when
> you design an iterable) is that iteration will hit every element
> exactly once. 

Does it actually say that somewhere?  For example:

for i in bag.pick_randomly_with_replacement(n=5):
   print i

shouldn't do that.

More information about the Python-list mailing list