Message362936
While I have no specific opinion on tarfile, I strongly disagree with a blanket prohibition on 'from None'. Its proper use is to maintain a defined API and hide irrelevant implementation details. Realistic toy example:
def f(x, y):
"Return (x+y)/y for non-zery y."
if y == 0: # Body 1: look ahead.
raise ValueError('y cannot be 0')
else:
return (x+y)/y
# or
try: # Body 2: leap first.
return (x+y)/y
except ZeroDivisionError:
raise ValueError('y cannot be 0') from None
'from e' instead of 'from None' would just add distracting noise. |
|
Date |
User |
Action |
Args |
2020-02-28 23:01:10 | terry.reedy | set | recipients:
+ terry.reedy, cool-RR, ethan.furman, martin.panter, veky |
2020-02-28 23:01:10 | terry.reedy | set | messageid: <1582930870.02.0.860513717486.issue39717@roundup.psfhosted.org> |
2020-02-28 23:01:10 | terry.reedy | link | issue39717 messages |
2020-02-28 23:01:09 | terry.reedy | create | |
|