update, passed · threaderic/examples@38224b3 · GitHub
Skip to content

Commit 38224b3

Browse files
committed
update, passed
1 parent b48bb6c commit 38224b3

4 files changed

Lines changed: 37 additions & 9 deletions

File tree

‎python/3.6.py‎

Lines changed: 10 additions & 2 deletions

‎python/3.7.py‎

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,26 @@
1212
var.set(2)
1313
assert(var.get() == 2)
1414

15-
from sys import *
16-
print("passed", version)
15+
import asyncio
16+
17+
buf = ''
18+
19+
async def corutine():
20+
global buf
21+
buf += '3'
22+
pass
23+
24+
async def test_task():
25+
global buf
26+
buf += '1'
27+
# Before:
28+
#task = asyncio.ensure_future(corutine())
29+
task = asyncio.create_task(corutine())
30+
buf += '2'
31+
await task
32+
buf += '4'
33+
34+
asyncio.run(test_task())
35+
assert(buf == '1234')
36+
37+
import passed

‎python/3.8.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#
55
# https://docs.python.org/3/whatsnew/3.8.html
66

7-
import unittest
87
from datetime import *
98

109
# Arguments before / are considered as positional arguments only
@@ -38,6 +37,7 @@ def add(x, y, /, z = 0):
3837

3938
assert(f'{i+i=}' == 'i+i=2')
4039

41-
from sys import *
40+
import asyncio
41+
# get_coro get_name set_name
4242

43-
print("passed", version)
43+
import passed

‎python/3.9.py‎

Lines changed: 1 addition & 2 deletions

0 commit comments

Comments
 (0)