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 rhettinger
Recipients gd2shoe, rhettinger
Date 2012-08-29.01:45:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1346204717.51.0.677136138237.issue15804@psf.upfronthosting.co.za>
In-reply-to
Content
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]
History
Date User Action Args
2012-08-29 01:45:17rhettingersetrecipients: + rhettinger, gd2shoe
2012-08-29 01:45:17rhettingersetmessageid: <1346204717.51.0.677136138237.issue15804@psf.upfronthosting.co.za>
2012-08-29 01:45:17rhettingerlinkissue15804 messages
2012-08-29 01:45:16rhettingercreate