Message195879
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. |
|
Date |
User |
Action |
Args |
2013-08-22 11:54:09 | zaytsev | set | recipients:
+ zaytsev, loewis, barry, rhettinger, jcea, ncoghlan, pitrou, eric.smith, ezio.melotti, alex, cvrebert, chris.jerdonek, python-dev |
2013-08-22 11:54:09 | zaytsev | set | messageid: <1377172449.35.0.494389782273.issue15806@psf.upfronthosting.co.za> |
2013-08-22 11:54:09 | zaytsev | link | issue15806 messages |
2013-08-22 11:54:09 | zaytsev | create | |
|