Guido van Rossum wrote: > The new exception could either be a designated (built-in) subclass of > StopIteration, or not; I think it would have to not be; otherwise any existing code that catches StopIteration would catch the new exception as well without complaint. Using a different exception raises another question. Would you check whether the return value is None and raise an ordinary StopIteration in that case? Or would return with a value always raise the new exception? If the latter, then 'return' and 'return None' would no longer be equivalent in all cases, which would be rather strange. > I think in either case a check in > PyIter_Next() would cover most cases If that's acceptable, then the check might as well be for None as the StopIteration value, and there's no need for a new exception. -- Greg
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