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
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com