A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2015-April/139721.html below:

[Python-Dev] PEP 492 vs. PEP 3152, new round

[Python-Dev] PEP 492 vs. PEP 3152, new roundEthan Furman ethan at stoneleaf.us
Thu Apr 30 20:22:55 CEST 2015
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~
More information about the Python-Dev mailing list

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