Nick Coghlan added the comment:

The sentinel form of next() is nice when there's a natural sentinel value, but 
needing to *create* a sentinel is generally a sign that the out-of-band 
exception is a better fit.

The function could likely do with some refactoring (e.g. breaking out some 
helper functions to make the logic easier to follow), but shifting from 
idiomatic code to non-idiomatic code isn't a good way of tackling that.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24474>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to