In article <ca471dc2040906184648d95e55 at mail.gmail.com>, Guido van Rossum <gvanrossum at gmail.com> wrote: > > It's not really the same subject, but the exception that gives me the > > most grief is StopIteration. I have to keep remembering to never call > > .next() without catching it; if I forget, I get bugs where some loop > > several levels back in the call tree mysteriously exits. > > Are you sure? This sounds like superstition to me, since that's not > how loops work. Raising StopIteration in the middle of a loop does not > break out of the loop -- only raising StopIteration from a next() > breaks a loop. > > Or are you talking about nested next() calls? That's the only case > where the behavior you are citing occurs. I don't remember, it could have been nested next()s. -- David Eppstein Computer Science Dept., Univ. of California, Irvine http://www.ics.uci.edu/~eppstein/
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4