Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Paste
P847
(An Untitled Masterwork)
Active
Public
Actions
Authored by
haltode
on Nov 3 2020, 9:48 AM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Subscribers
None
import
asyncio
from
typing
import
AsyncGenerator
,
AsyncIterator
async
def
gen
()
->
AsyncGenerator
[
int
,
None
]:
for
x
in
[
1
,
2
,
3
]:
yield
x
async
def
gen2
()
->
AsyncIterator
[
int
]:
for
x
in
[
1
,
2
,
3
]:
yield
x
async
def
main
():
async
for
x
in
gen
():
print
(
x
)
async
for
x
in
gen2
():
print
(
x
)
asyncio
.
run
(
main
())
Event Timeline
haltode
created this paste.
Nov 3 2020, 9:48 AM
2020-11-03 09:48:30 (UTC+1)
haltode
created this object in space
S1 Public
.
Log In to Comment