This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Ted Shaneyfelt
Recipients Ted Shaneyfelt
Date 2017-02-06.21:11:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1486415491.45.0.543077011727.issue29467@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2017-02-06 21:11:31Ted Shaneyfeltsetrecipients: + Ted Shaneyfelt
2017-02-06 21:11:31Ted Shaneyfeltsetmessageid: <1486415491.45.0.543077011727.issue29467@psf.upfronthosting.co.za>
2017-02-06 21:11:31Ted Shaneyfeltlinkissue29467 messages
2017-02-06 21:11:31Ted Shaneyfeltcreate