A question appeared here about a simple mental model for PEP 550. It looks much clearer now, than in the first version, but I still would like to clarify: can one say that PEP 550 just provides more fine-grained version of threading.local(), that works not only per thread, but even per coroutine within the same thread? -- Ivan On 28 August 2017 at 17:29, Yury Selivanov <yselivanov.ml at gmail.com> wrote: > On Mon, Aug 28, 2017 at 11:26 AM, Ethan Furman <ethan at stoneleaf.us> wrote: > > 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. ;) > > You're right! > > Yury > _______________________________________________ > Python-Dev mailing list > Python-Dev at python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: https://mail.python.org/mailman/options/python-dev/ > levkivskyi%40gmail.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20170828/7a37f4c3/attachment.html>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4