We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4bb94de commit a74720eCopy full SHA for a74720e
mypyc/test-data/run-async.test
@@ -415,5 +415,26 @@ async def exc(n: int) -> list[str]:
415
def test_exception() -> None:
416
assert_no_leaks(lambda: exc(100), 2)
417
418
+class C:
419
+ def __init__(self, s: str) -> None:
420
+ self.s = s
421
+
422
+async def id(c: C) -> C:
423
+ return c
424
425
+async def stolen_helper(c: C, s: str) -> str:
426
+ (await id(c)).s = await concat_one(s)
427
+ return c.s
428
429
+async def stolen(n: int) -> int:
430
+ for i in range(n):
431
+ c = C(str(i))
432
+ s = await stolen_helper(c, str(i + 2))
433
+ assert s == str(i + 2) + "1"
434
+ return n
435
436
+def test_stolen() -> None:
437
+ assert_no_leaks(lambda: stolen(1000), 2)
438
439
[file asyncio/__init__.pyi]
440
def run(x: object) -> object: ...
0 commit comments