[Tim] >> for-that-matter-i'm-a-fan-of-"from-m-import-x-as-y"-too-ly y'rs - tim [Guido] > Hm. Predictably, I'm worried about adding 'as' as a reserved word. But it doesn't need to be, right? That is, change the stuff following 'import' in 'from' dotted_name 'import' ('*' | NAME (',' NAME)*) to ('*' | NAME [NAME NAME] (',' NAME [NAME NAME])*) and verify that whenever the 3-NAME form triggers that the middle of the NAMEs is exactly "as". The grammar in the Reference Manual can still advertise it as a syntactic constraint; if a particular implementation happens to need to treat it as a semantic constraint due to parser limitations (and CPython specifically would), the user will never know it. It doesn't interfere with using "as" a regular NAME elsewhere. Anyone pointing out that the line from as import as as as would then be legal will be shot. Fortran had no reserved words of any kind, and nobody abused that in practice. Users may be idiots, but they're not infants <wink>.
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