Message169327
FWIW, this is already easy to do with decorators:
>>> class Pass:
def __init__(self, exc):
self.exc = exc
def __enter__(self):
return self
def __exit__(self, exctype, excinst, exctb):
return exctype == self.exc
>>> with Pass(IndexError):
'hello'[10] |
|
Date |
User |
Action |
Args |
2012-08-29 01:45:17 | rhettinger | set | recipients:
+ rhettinger, gd2shoe |
2012-08-29 01:45:17 | rhettinger | set | messageid: <1346204717.51.0.677136138237.issue15804@psf.upfronthosting.co.za> |
2012-08-29 01:45:17 | rhettinger | link | issue15804 messages |
2012-08-29 01:45:16 | rhettinger | create | |
|