Re: [Python-Dev] Creating APIs that work as both decorators and context managers

2010-06-25 Thread Michael Foord
On 25/06/2010 19:35, Michael Foord wrote: Hello all, I've put a recipe up on the Python cookbook for creating APIs that work as both decorators and context managers and wonder if it would be considered a useful addition to the functools module. http://code.activestate.com/recipes/577273-deco

Re: [Python-Dev] Creating APIs that work as both decorators and context managers

2010-06-25 Thread Mark Dickinson
On Fri, Jun 25, 2010 at 7:35 PM, Michael Foord wrote: > Hello all, > > I've put a recipe up on the Python cookbook for creating APIs that work as > both decorators and context managers and wonder if it would be considered a > useful addition to the functools module. > http://code.activestate.com/r

[Python-Dev] Creating APIs that work as both decorators and context managers

2010-06-25 Thread Michael Foord
Hello all, I've put a recipe up on the Python cookbook for creating APIs that work as both decorators and context managers and wonder if it would be considered a useful addition to the functools module. http://code.activestate.com/recipes/577273-decorator-and-context-manager-from-a-single-api