Adds support for "async with" via #1818

This commit is contained in:
jerluc
2021-11-16 12:34:41 -08:00
parent 42c5276e04
commit 8847848a03
2 changed files with 26 additions and 0 deletions

View File

@@ -105,3 +105,22 @@ async def f():
f = await C().async_for_classmethod()
#? C()
f
class AsyncCtxMgr:
def some_method():
pass
async def __aenter__(self):
return self
async def __aexit__(self, *args):
pass
async def asyncctxmgr():
async with AsyncCtxMgr() as acm:
#? AsyncCtxMgr()
acm
#? ['some_method']
acm.som