[New-bugs-announce] [issue39516] ++ does not throw a SyntaxError

Marco Sulla report at bugs.python.org
Sat Feb 1 05:48:01 EST 2020


New submission from Marco Sulla <launchpad.net at marco.sulla.e4ward.com>:

Python 3.9.0a0 (heads/master-dirty:d8ca2354ed, Oct 30 2019, 20:25:01) 
[GCC 9.2.1 20190909] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 1 ++ 2
3

This is probably because the interpreter reads:

1 + +2

1. ++ could be an operator in future. Probably not. Probably never. But you never know.
2. A space between an unary operator and the object should not be allowed
3. the first expression is clearly unreadable and hard to understand, so completely unpythonic

----------
components: Interpreter Core
messages: 361159
nosy: Marco Sulla
priority: normal
severity: normal
status: open
title: ++ does not throw a SyntaxError
type: behavior
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39516>
_______________________________________


More information about the New-bugs-announce mailing list