On Thu, Mar 1, 2018 at 5:03 AM, Kirill Balunov email@example.com wrote:
The PEP says:
Omitting the parentheses from this PEP's proposed syntax introduces many syntactic ambiguities.
As the name's scope extends to the full current statement, even a block statement, this can be used to good effect in the header of an if or while statement
Will the `from ... import ... as ... statement be a special case, because currently the following form is valid:
from math import (tau as two_pi)
No, because that statement doesn't have any expressions in it - it's a series of names. The "tau" in that line is not looked up in the current scope; you can't write a function that returns the symbol "tau" and then use that in the import. So the grammatical hook that enables "(... as ...)" doesn't apply here.