A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/attachments/20171018/bb1fb6c9/attachment.html below:

<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Oct 18, 2017 at 10:50 AM, Yury Selivanov <span dir="ltr"><<a href="mailto:yselivanov.ml@gmail.com" target="_blank">yselivanov.ml@gmail.com</a>></span> wrote:<span class=""></span><br><span class=""></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
</span>The main reason why I don't like 'set_ctx()' is because it would make<br>
it harder for us to adopt PEP 550-like design later in the future<br>
(*if* we need that.)<br>
<br>
PEP 550 is designed in such a way, that 'generator.send()' is the only<br>
thing that can control the actual stack of LCs.  If users can call<br>
'set_ctx' themselves, it means that it's no longer safe for<br>
'generator.send()' to simply pop the topmost LC from the stack.  This<br>
can be worked around, potentially, but the we don't actually need<br>
'set_ctx' in asyncio or in any other async framework.  There is simply<br>
no hard motivation to have it.  That's why I'd like to have just<br>
Context.run(), because it's sufficient, and it doesn't burn the bridge<br>
to PEP 550-like design.<span class="HOEnZb"><font color="#888888"><br>
</font></span></blockquote></div><br></div><div class="gmail_extra">Honestly that stack-popping in send() always felt fragile to me, so I'd be happy if we didn't need to depend on it.</div><div class="gmail_extra"><br></div><div class="gmail_extra">That said I'm okay with presenting set_ctx() *primarily* as an educational tool for showing how Context.run() works. We could name it _set_ctx() and add a similar note as we have for sys._getframe(), basically keeping the door open for future changes that may render it non-functional without worries about backward compatibility (and without invoking the notion of "provisional" API).</div><div class="gmail_extra"><br></div><div class="gmail_extra">There's no problem with get_ctx() right?<br clear="all"></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div></div>

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