SwashBuckler001's picture
IdiomBench (part 6)
60f5111 verified
Raw History Blame Contribute Delete
289 Bytes
async def square_series(con, to):
async with con.transaction():
cursor = con.cursor(
'SELECT generate_series(0, $1) AS i', to)
async for row in cursor:
yield row['i'] ** 2
async for i in square_series(con, 1000):
if i == 100:
break