On Thu, Apr 30, 2015 at 8:30 PM, Nathaniel Smith <njs at pobox.com> wrote: > The actual effect of making "await" a different precedence is to resolve > the ambiguity in > > await x ** 2 > > If await acted like -, then this would be > await (x ** 2) > But with the proposed grammar, it's instead > (await x) ** 2 > Which is probably correct, and produces the IMHO rather nice invariant > that "await" binds more tightly than arithmetic in general (instead of > having to say that it binds more tightly than arithmetic *except* in this > one corner case...) > Correct. > AFAICT these and the ** case are the only expressions where there's any > difference between Yury's proposed grammar and your proposal of treating > await like unary minus. But then given the limitations of Python's parser > plus the desire to disambiguate the expression above in the given way, it > becomes an arguably regrettable, yet inevitable, consequence that > await -fut > await +fut > await ~fut > become parse errors. > Why is that regrettable? Do you have a plan for overloading one of those on Futures? I personally consider it a feature that you can't do that. :-) -- --Guido van Rossum (python.org/~guido) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20150430/5ed9226f/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