New submission from John Belmonte <j...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue37398>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to