Message188186
>>> Printing a fragment of the logical line is clearly not very helpful
Given the unbounded and recursive nature of 'logical line', I disagree with that as a general, versus special-case, statement.
Consider:
r(a()/b(),
d()/e(),
g=h()/i(),
)
If either e() or i() returns 0, printing all 4 lines is less helpful, by adding noise (which line has the error?), than just printing the 1 line with the ZeroDivisionError. The context is irrelevant.
Or consider:
mymegalist = {
a,
b,
... <500 lines, one item per line>
xyz,
}
If 1 of the expressions raises an error, do you really want all 500 lines in the traceback? Again, the context is probably irrelevant.
Quite aside from this, 'd()/e(),' and 'g=h()/i(),' are both legal logical lines in themselves (though with different semantics) as well as being fragments of the r call.
Moreover, the multiline r call above may itself be just a fragment of a call to another function (further indented). The practical difficulty for the proposal, even if limited to multiline calls, is that any bare call could either be part of a larger expression by returning something or be a statement operating through side-effects. Similarly, any 'var=f()' call could either be an assignment statement or keyword arg expression in some other call. |
|
Date |
User |
Action |
Args |
2013-04-30 21:20:21 | terry.reedy | set | recipients:
+ terry.reedy, georg.brandl, ncoghlan, giampaolo.rodola, ezio.melotti, psss, r.david.murray, flox, lesmana, petri.lehtinen, icordasc, dmi.baranov |
2013-04-30 21:20:21 | terry.reedy | set | messageid: <1367356821.06.0.030867292176.issue12458@psf.upfronthosting.co.za> |
2013-04-30 21:20:21 | terry.reedy | link | issue12458 messages |
2013-04-30 21:20:20 | terry.reedy | create | |
|