[issue37398] contextlib.ContextDecorator decorating async functions

John Belmonte report at bugs.python.org
Tue Jun 25 02:50:03 EDT 2019


New submission from John Belmonte <john at neggie.net>:

A case came up where I'd like a non-async context manager to be able to decorate both regular and async functions.  I wonder why contextlib.ContextDecorator doesn't just support both cases.

The implementation seems straightforward, switching on iscoroutinefunction().

----------
components: Library (Lib)
messages: 346485
nosy: John Belmonte
priority: normal
severity: normal
status: open
title: contextlib.ContextDecorator decorating async functions
type: enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37398>
_______________________________________


More information about the Python-bugs-list mailing list