Message287173
def f():
try: return 0
except: return 1,2
x = f() # x is 0
x,y = f() # proposal: x,y should be 1,2 instead of uncaught TypeError
It would make sense to be able to catch [TypeError: 'int' object is not iterable] and return the correct number of values. Yes, the way it's done now, the function is no longer running when it is caught - but is it possible and practical to determine if parameters match before the function returns instead of afterward, allowing the called function to catch the error attempting to return? |
|
Date |
User |
Action |
Args |
2017-02-06 21:11:31 | Ted Shaneyfelt | set | recipients:
+ Ted Shaneyfelt |
2017-02-06 21:11:31 | Ted Shaneyfelt | set | messageid: <1486415491.45.0.543077011727.issue29467@psf.upfronthosting.co.za> |
2017-02-06 21:11:31 | Ted Shaneyfelt | link | issue29467 messages |
2017-02-06 21:11:31 | Ted Shaneyfelt | create | |
|