On Fri, May 18, 2018 at 9:59 PM, Steven D'Aprano email@example.com wrote:
That's even assuming such a context-sensitive grammar would be possible within the requirement that Python's parser is LL(1).
I'm sure it could be done, but it may impact existing Python grammar. So backward compatibility might mean making certain words "keywords" in contexts where they otherwise wouldn't be, and then just throwing SyntaxError because it would have been ambiguous.
But even if it's possible, I don't think it's desirable.