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/20150428/8254bf6c/attachment.html below:

<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Apr 28, 2015 at 11:44 AM, Mark Shannon <span dir="ltr"><<a href="mailto:mark@hotpy.org" target="_blank">mark@hotpy.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I still think that there are several issues that need addressing with PEP 492. This time, one issue at a time :)<br>
<br>
"async"<br>
<br>
The "Rationale and Goals" of PEP 492 states that PEP 380 has 3 shortcomings.<br>
The second of which is:<br>
  Â  """It is not possible to natively define a coroutine which has no yield or yield from statements."""<br>
  Â This is incorrect, although what is meant by 'natively' is unclear.<br>
<br>
A coroutine without a yield statement can be defined simply and concisely, thus:<br>
<br>
@coroutine<br>
def f():<br>
  Â  return 1<br>
<br>
This is only a few character longer than the proposed new syntax,<br>
perfectly explicit and requires no modification the language whatsoever.<br>
A pure-python definition of the "coroutine" decorator is given below.<br>
<br>
So could the "Rationale and Goals" be correctly accordingly, please.<br>
Also, either the "async def" syntax should be dropped, or a new justification is required.<br></blockquote><div><br></div><div>So here's *my* motivation for this. I don't want the code generator to have to understand decorators. To the code generator, a decorator is just an expression, and it shouldn't be required to understand decorators in sufficient detail to know that *this* particular decorator means to generate different code.<br><br></div><div>And it's not just generating different code -- it's also the desire to issue static errors (SyntaxError) when await (or async for/with) is used outside a coroutine, or when yield [from] is use inside one.<br><br></div><div>The motivation is clear enough to me (and AFAIR I'm the BDFL for this PEP :-).<br clear="all"></div></div><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