
On 09.08.19 03:53, Eric V. Smith wrote:
On 8/8/2019 7:28 PM, Barry Warsaw wrote:
On Aug 8, 2019, at 14:58, Steven D'Aprano <steve@pearwood.info> wrote:
It's not a syntax error. There's nothing wrong with the syntax per-say: we still have ``target := expression``. There's a problem with the *semantics* not the syntax.
I’m not sure that distinction is meaningful though. What you wrote is disallowed, so you have to change your code (i.e. syntax) to avoid the error.
I agree with Barry here. For all practical purposes, it's a syntax error. And if we had a more powerful parser, maybe it really would be a syntax error. See Guido's recent PEG parser articles (https://medium.com/@gvanrossum_83706/peg-parsers-7ed72462f97c) where he discusses raising SyntaxError after the parser is finished, in a subsequent pass. Is it really a syntax error if pgen doesn't object to it? In current CPython, the answer is yes.
... OT: Thanks for the interesting read! I am excited which way it will continue. -- Christian Tismer :^) tismer@stackless.com Software Consulting : http://www.stackless.com/ Karl-Liebknecht-Str. 121 : https://github.com/PySide 14482 Potsdam : GPG key -> 0xFB7BEE0E phone +49 173 24 18 776 fax +49 (30) 700143-0023