Title: "1and 0" evaluated a zero, instead of SyntaxError
Type: Stage: resolved
Components: Versions: Python 3.4, Python 3.5, Python 2.7
Status: closed Resolution: duplicate
Dependencies: Superseder: On Python parsing numbers.
View: 13610
Assigned To: Nosy List: berker.peksag, rutsky
Priority: normal Keywords:

Created on 2016-05-02 16:59 by rutsky, last changed 2016-05-02 17:12 by berker.peksag. This issue is now closed.

Messages (2)
msg264654 - (view) Author: Vladimir Rutsky (rutsky) Date: 2016-05-02 16:59
Looks like there is no need to place space separators after numbers:

$ python3.5 -c "print(1and 0)"
$ python3.5 -c "print([1for i in range(1)])"

Not sure is this a bug or a feature, but I would expect that this should be SyntaxError, same as here:

$ python3.5 -c "1 and0"
  File "<string>", line 1
    1 and0
SyntaxError: invalid syntax

If this is a feature, can anyone give reasoning for it?
msg264656 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-05-02 17:12
Thanks for the report. This is a duplicate of issue 13610. You can read issue 13610 for more information.
Date User Action Args
2016-05-02 17:12:25berker.peksagsetstatus: open -> closed

superseder: On Python parsing numbers.

nosy: + berker.peksag
messages: + msg264656
resolution: duplicate
stage: resolved
2016-05-02 16:59:43rutskycreate