[Python-Dev] PEP 492 vs. PEP 3152, new round (original) (raw)

Yury Selivanov yselivanov.ml at gmail.com
Thu Apr 30 00:11:51 CEST 2015


On 2015-04-29 3:24 PM, Isaac Schwabacher wrote:

On 15-04-29, Yury Selivanov wrote:

Hi Ethan, [..] So I want to make this syntactically incorrect: Does this need to be a syntax error? -"hello" raises TypeError because str doesn't have a neg, but there's no reason a str subclass couldn't define one. "TypeError: bad operand type for unary -: 'asyncio.Future'" is enough to clear up any misunderstandings, and if someone approaching a new language construct doesn't test their code well enough to at least execute all the code paths, the difference between a compile-time SyntaxError and a run-time TypeError is not going to save them.

The grammar of the language should match the most common use case.

FWIW, I've just updated the pep with a precedence table: https://hg.python.org/peps/rev/d355918bc0d7

Yury



More information about the Python-Dev mailing list