Breaking out of nested loops

Tal Linzen pachy at 012.net.il
Sat Jan 12 06:14:59 EST 2002


Good day.

One feature I miss in python is the ability to break out of nested loops.
I've searched the newsgroup archives, and found a few threads discussing the
problem, with no apparent conclusion. The two solutions I've seen -- raising
an exception, or putting the loop inside a function and using the return
statement -- are unintuitive (meaning, I didn't come up with them myself
:-) ).

Know if anyone has drafted a PEP for a syntactic solution for this problem?

Tal





More information about the Python-list mailing list