Yury V. Zaytsev added the comment:
Hi Raymond,
This is a brilliant idea, but before it hits the streets, couldn't you possibly
consider extending it with a kwarg to control the depth of the exception stack?
The use case I have for that are snippets like this:
with ignored(ValueError, TypeError), ignored(ValueError, TypeError),
ignored(ValueError, TypeError):
a()
b()
c()
Or else I could write this as
with ignored(ValueError, TypeError):
a()
with ignored(ValueError, TypeError):
b()
with ignored(ValueError, TypeError):
c()
... but either way it looks bad. This looks a bit better to me:
with ignored(ValueError, TypeError, depth=3):
a()
b()
c()
If you deem this to be unacceptably unpythonic, then please ignore my
suggestion.
----------
nosy: +zaytsev
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue15806>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com