Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
executable file
·
47 lines (33 loc) · 825 Bytes

File metadata and controls

executable file
·
47 lines (33 loc) · 825 Bytes
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env python3.7
# https://docs.python.org/3/whatsnew/3.7.html
# https://realpython.com/python37-new-features/
import asyncio
import sys
from contextvars import ContextVar
import dataclasses
import importlib.resources
from passed import passed
var: ContextVar[int] = ContextVar('var', default=1)
assert var.get() == 1
var.set(2)
assert var.get() == 2
buf = ''
async def corutine():
global buf
buf += '3'
async def test_task():
global buf
buf += '1'
# Before:
# task = asyncio.ensure_future(corutine())
task = asyncio.create_task(corutine())
buf += '2'
await task
buf += '4'
asyncio.run(test_task())
assert buf == '1234'
breakpoint_passed = False
sys.breakpointhook = lambda: globals().update(breakpoint_passed=True)
breakpoint()
assert breakpoint_passed
passed()
Morty Proxy This is a proxified and sanitized view of the page, visit original site.