Message225713
> Using 'expression' (or 'expr' in the ast doc) for what should be 'exceptions: identifier' or paranthesized tuple of identifiers;, is also too broad. However, that must be enforced in the compiler rather than the parser, and compiler restrictions are in the text, not the grammar.
I would expect any expression to be valid so long as it evaluates at runtime to an exception type (or tuple of exception types), so the use of expression seems correct to me. In other words, the following is valid Python (but would not be allowed if I've understood your statement correctly):
def f():
try:
"".blah
except some_error():
print("caught")
def some_error():
return AttributeError
f() |
|
Date |
User |
Action |
Args |
2014-08-22 21:10:44 | mwilliamson | set | recipients:
+ mwilliamson, terry.reedy, docs@python, jayanthkoushik |
2014-08-22 21:10:44 | mwilliamson | set | messageid: <1408741844.89.0.409626683629.issue22243@psf.upfronthosting.co.za> |
2014-08-22 21:10:44 | mwilliamson | link | issue22243 messages |
2014-08-22 21:10:44 | mwilliamson | create | |
|