Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In Python, an iterator raises a StopIteration exception to indicate to the for loop that the iterator is done iterating.

In Python, the VM raises a KeyboardInterrupt exception when the user hits ctrl+c in order to unwind the stack, run cleanup code and eventually exit the program.

Python is a quite heavy user of exceptions for control flow.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: