New submission from Jason Fried <[email protected]>:
The standard contextmanager decorator produces a wrapper that itself can be
used as a decorator
```
@contextmanager
def some_context():
...
yield
@some_context()
def some_function():
# we are inside a with some_context() now.
...
```
When I created a version of asynccontextmanager internally before it was
available in the stdLib I copied this behavior and I have people internally to
facebook using this behavior, Was there a reason this behavior was not
replicated to asynccontextmanager?
I have a diff an tests to add
----------
components: Library (Lib)
messages: 354232
nosy: fried, yselivanov
priority: normal
severity: normal
status: open
title: @asynccontextmanager decorated functions are not callable like
@contextmanager
type: enhancement
versions: Python 3.7, Python 3.8, Python 3.9
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue38415>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com