Marco Sulla <launchpad....@marco.sulla.e4ward.com> added the comment:

> `++` isn't special

Indeed the problem is that no error or warning is raised if two operators are 
consecutive, without a space between. All the cases you listed are terribly 
unreadable and hardly intelligible. 

Anyway I do not agree `++` is not special:

> you should know that this example is a syntax error because you are missing 
> the right hand operand, not because `++` has no meaning

But you should know that in a *lot* of other popular languages, `++` and `--` 
are unary operators, so it's particularly surprisingly to see that they *seems* 
to work in Python, even if they *seems* to be a binary operator.

This is completely confusing and messy. Frankly, I'm not a PEP 8 orthodox at 
all. I think that you can write `a+b`. It's not elegant, it's a bit less 
readable that `a + b`, but it's not the end of the world. 

But you should *not* be allowed to write `a+-b` without at least a warning, 
because `+-` seems a binary operator. And you should not be able to write `a+ 
-b` too, with the interpreter that acts like Ponzio Pilato, because what's 
this? Is it an unary `+` or an unary `-`? 
We know the unary is the `-`, `a+` has no sense. but for someone that does not 
know Python, __it's not readable__. So, IMHO, the interpreter should at least 
raise a warning if the syntax is not: 
`a + -b`
for any combination of binary and unary operators.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39516>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to