Showing content from http://mail.python.org/pipermail/python-dev/attachments/20150428/3680df3e/attachment.html below:
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Apr 28, 2015 at 11:51 AM, Stefan Behnel <span dir="ltr"><<a href="mailto:stefan_ml@behnel.de" target="_blank">stefan_ml@behnel.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Mark Shannon schrieb am 27.04.2015 um 09:48:<br>
> On 27/04/15 00:13, Guido van Rossum wrote:<br>
</span><span class="">>> Currently this means looking for yield [from]; PEP 492 just adds looking<br>
>> for await and async [for|with]. Making await() a function defeats the<br>
>> purpose because now aliasing can hide its presence, and we're back in<br>
>> the land of gevent or stackless (where *anything* can potentially<br>
>> suspend the current task). I don't want to live in that land.<br>
><br>
> I don't think I was clear enough. I said that "await" *is* a function, not<br>
> that is should be disguised as one. Reading the code, "GetAwaitableIter"<br>
> would be a better name for that element of the implementation. It is a<br>
> straightforward non-blocking function.<br>
<br>
</span>1) it's not like people commonly alias "repr()" or "len()", so why would<br>
they alias an "await()" builtin ? Unless, obviously, there's an actual<br>
reason to do so, in which case having it as a functions comes in handy. :)<br>
We had the same line of reasoning with "print()" back in the days of Py3k.<br>
<br>
2) an "await()" builtin function that calls an "__await__()" special method<br>
on its input object sounds very pythonic.<span class="HOEnZb"></span><br></blockquote></div><br></div><div class="gmail_extra">This sounds confused. The await expression must be recognized by the parser so it can generate different code for it (the code to suspend the stack). A builtin function cannot generate different code -- to the compiler all functions look the same. I know we could change that rule, but that' would be a really a big deviation from Python's philosophy: Currently the code generator never needs to know the type of any variables -- and a builtin function 'await' would just be another variable to the code generator.<br clear="all"></div><div class="gmail_extra"><br>-- <br><div class="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