Author ncoghlan
Recipients jackdied, michael.foord, ncoghlan, rhettinger
Date 2010-07-10.07:59:57
SpamBayes Score 0.000206899
Marked as misclassified No
Message-id <>
The idea of building this into contextlib actually came out on off-list discussion between Michael and I. To quote the original suggestion he sent to me:

"""What do you think about adding ContextDecorator to contextlib for Python 3.2?

It's a simple recipe but useful nonetheless (and Barry Warsaw at least is very enthusiastic about it ;-).

ContextDecorator allows you to create APIs that behave as both context managers and as decorators. It also provides the optional exception handling capability of __exit__ for decorators. This isn't an uncommon pattern, used in libraries like mock, py.test and django, and it is at least slightly fiddly to get right."""

I agree it is good to have that additional motivation (and the reference to previous work) here in the tracker issue rather than squirreled away in a couple of private email archives.
Date User Action Args
2010-07-10 08:00:00ncoghlansetrecipients: + ncoghlan, rhettinger, jackdied, michael.foord
2010-07-10 08:00:00ncoghlansetmessageid: <>
2010-07-10 07:59:58ncoghlanlinkissue9110 messages
2010-07-10 07:59:57ncoghlancreate