[issue35446] incorrect example

Serhiy Storchaka report at bugs.python.org
Mon Dec 10 05:05:09 EST 2018


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

The example is correct. If the except clauses were reversed

for cls in [B, C, D]:
    try:
        raise cls()
    except B:
        print("B")
    except C:
        print("C")
    except D:
        print("D")

it would have printed B, B, B.

----------
nosy: +serhiy.storchaka
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

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


More information about the Python-bugs-list mailing list