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 eric.smith
Recipients Ted Shaneyfelt, eric.smith
Date 2017-02-07.00:55:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1486428903.87.0.808852385461.issue29467@psf.upfronthosting.co.za>
In-reply-to
Content
Thanks for the suggestion. However, I don't think it's possible or desirable for python to implement this.

There are two problems: 1) the internals of python would have to be drastically changed to support this, and 2) you'd need different syntax to support this.

For item 2, consider:

def f():
    try: return some_other_function()
    except: return 1,2

You can't distinguish between your proposed type mis-match exception and some_other_function() raising a TypeError. I suppose you could invent another exception type, but you'll always have a similar problem.

A larger problem is that this behavior would be confusing to both newcomers and existing programmers, it adds nothing that can't currently be done, and it would be a source of subtle bugs.

If you really want to explore this, I suggest working out a more complete example and bringing it up on the python-ideas mailing list.

You'll want to include code that currently exists that would be made simpler with your proposal. If you can find any such code in the standard library, that would be a bonus.

Thanks again.
History
Date User Action Args
2017-02-07 00:55:03eric.smithsetrecipients: + eric.smith, Ted Shaneyfelt
2017-02-07 00:55:03eric.smithsetmessageid: <1486428903.87.0.808852385461.issue29467@psf.upfronthosting.co.za>
2017-02-07 00:55:03eric.smithlinkissue29467 messages
2017-02-07 00:55:03eric.smithcreate