◐ Shell
clean mode source ↗

Message 66580 - Python tracker

Should nested tuples in an except clause be a valid syntax?
like:
...
except ((ValueError, Exception), TypeError, (...)):
    pass

I don't see any benefit and because of this behavior the implementation
(in Python/errors.c and in the patch attached) will use recursive function. 

I think that any objects inside a tuple in an except clause should be
treated equally (as an object), even a tuple, so the except clause above
should be an error in py3k and should produce a warning because the list
objects does not inherits BaseException.

Please, see my comment in http://bugs.python.org/issue2345, it is
related to this issue.