[issue45058] Undefined behavior for syntax "except AError or BError:" accepted by interpreter

Serhiy Storchaka report at bugs.python.org
Wed Sep 1 03:01:16 EDT 2021


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Yes, it is syntactically correct. It can even make sense. But the meaning is different from "except (AError, BError)". If it looks confusing to you, it is a work of linters to warn about misleading or suspicions code.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45058>
_______________________________________


More information about the Python-bugs-list mailing list