In your example, why do you "raise StopIteration" instead just writing "return"? ----- Original Message ----- From: "Manuel Alejandro CerĂ³n Estrada" <ceronman at gmail.com> Take a look at this example: def lines(): for line in my_file: if some_error(): raise StopIteration() yield line yield 'end' for line in lines(): do_something()
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