[issue44271] asyncio random carsh with longtime run

2021-05-31 Thread 世界第一好吃
世界第一好吃 added the comment: I test it on OS :Windows 10 Pro x64 Python: 3.9.5 x64 This Code if work will it will print "are you ok" and stop. bug it print a random line like "done task 20897" ,stop print ,press Ctrl+C cannot break it. -- ___ Python

[issue44271] asyncio random carsh with longtime run

2021-05-31 Thread Irit Katriel
Irit Katriel added the comment: What’s the output, what system are you using? -- nosy: +iritkatriel ___ Python tracker ___ ___

[issue44271] asyncio random carsh with longtime run

2021-05-31 Thread 世界第一好吃
New submission from 世界第一好吃 : import asyncio import timeit num = 0 async def test(): global num num += 1 print(f"done task {num}") return f"task: {num}" async def main(): task = asyncio.create_task(test()) # ko = await test() # print(await task, ko) if __name__