On Sun, Mar 7, 2010 at 5:37 PM, Steven D'Aprano <st...@pearwood.info> wrote: >> "There should be one-- and preferably only one --obvious way to do >> it" http://www.python.org/dev/peps/pep-0020/ > > This doesn't mean that there should be *only* one way to do something. > It means that the should be one OBVIOUS way to do it. >
And in this case, if you consider "the thing to do" to be traversal of some collection, the one obvious way to do it is through iteration. So, the iterator protocol is a perfect example of this part of the zen; the flexibility you have in implementing iteration is necessary to allow it to be the one way. Hugo _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor