Eric V. Smith added the comment:
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.
----------
nosy: +eric.smith
resolution: -> rejected
stage: -> resolved
status: open -> closed
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue29467>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com