[Python-Dev] PEP 492 vs. PEP 3152, new round (original) (raw)
Ethan Furman ethan at stoneleaf.us
Thu Apr 30 20:22:55 CEST 2015
- Previous message (by thread): [Python-Dev] PEP 492 vs. PEP 3152, new round
- Next message (by thread): [Python-Dev] PEP 492 vs. PEP 3152, new round
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 04/30, Yury Selivanov wrote:
On 2015-04-30 1:56 PM, Ethan Furman wrote:
I still want to see where my current grammar forces to use parens. See [1], there are no useless parens anywhere.
--> await -coro() SyntaxError --> await (-coro()) # not a SyntaxError, therefore parens are # forced
In other words, a SyntaxError is nat any clearer than "AttributeError: obj has no neg method" and it's not any clearer than "AwaitError: neg returned not-awaitable". Those last two errors tell you exactly what you did wrong. This is debatable. "obj has no neg method" isn't obvious to everyone (especially to those people who aren't using operator overloading).
Good news! The error there is actually
--> -object() TypeError: bad operand type for unary -: 'object'
Which is definitely clear, even for those who don't do operator overloading.
--
Ethan
- Previous message (by thread): [Python-Dev] PEP 492 vs. PEP 3152, new round
- Next message (by thread): [Python-Dev] PEP 492 vs. PEP 3152, new round
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]