Jelle Zijlstra <jelle.zijls...@gmail.com> added the comment:
This sort of thing would be better caught by a linter or type checker. For example, mypy with the `--warn-unreachable` option will flag the `while None:` example. Iterating over an empty list will not currently be caught by mypy, but it's common in real code to iterate over a list that may be empty, so it would be a major compatibility break for Python to error when iterating over an empty list. ---------- nosy: +JelleZijlstra resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue47202> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com