Re: [Python-Dev] PEP 550 v4

2017年8月28日 08:29:58 -0700

On 08/28/2017 04:19 AM, Stefan Krah wrote:
What about this?
async def bar():
 setcontext(Context(prec=1))
 for i in range(10):
 await asyncio.sleep(1)
 yield i
async def foo():
 async for i in bar():
 # ctx.prec=1?
 print(Decimal(100) / 3)
If I understand correctly, ctx.prec is whatever the default is, because foo comes before bar on the stack, and after the current value for i is grabbed bar is no longer executing, and therefore no longer on the stack. I hope I'm right. ;)
--
~Ethan~
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to