Bug report
Bug description:
The plus and minus symbols can be regarded as numeric sign flag before an operands, but it seems Python can put multiple plus or minus after operators and before operands , and Python do not report any exception something like invalid argument to operation. The operations results depends on the number of signs for minus symbols, that is quite wired.
For Java or other language, they do report syntax errors. Think about the following codes, they all work.
Should we report syntax error for this situation?
#
a=3; b=4
c=a *+ b
print(c)
a=3; b=4
c=a *++++++ b
print(c)
a=3; b=4
c=a *- b
print(c)
a=3; b=4
c=a *-- b
print(c)
a=3; b=4
c=a *--- b
print(c)
a=3; b=4
c=a /+++--- b
print(c)
'''Output:
12
12
-12
12
-12
-0.75
'''
CPython versions tested on:
CPython main branch
Operating systems tested on:
Windows