Closed as not planned
Closed as not planned
Description
Bug report
There's the following difference in behavior between 3.11 and 3.12.
cpython on ξ main via C v14.0.3-clang via π pyenv 3.11.3
β― cat tmp/t.py
def f():
x = 0
\
%
cpython on ξ main via C v14.0.3-clang via π pyenv 3.11.3
β― ../cpython-versions/3.11.3/build/bin/python3.11 -m tokenize tmp/t.py
0,0-0,0: ENCODING 'utf-8'
1,0-1,3: NAME 'def'
1,4-1,5: NAME 'f'
1,5-1,6: OP '('
1,6-1,7: OP ')'
1,7-1,8: OP ':'
1,8-1,9: NEWLINE '\n'
2,0-2,2: INDENT ' '
2,2-2,3: NAME 'x'
2,4-2,5: OP '='
2,6-2,7: NUMBER '0'
2,7-2,8: NEWLINE '\n'
4,2-4,3: NEWLINE ''
5,0-5,0: DEDENT ''
5,0-5,0: ENDMARKER ''
cpython on ξ main via C v14.0.3-clang via π pyenv 3.11.3
β― ./python.exe -m tokenize tmp/t.py
0,0-0,0: ENCODING 'utf-8'
1,0-1,3: NAME 'def'
1,4-1,5: NAME 'f'
1,5-1,6: OP '('
1,6-1,7: OP ')'
1,7-1,8: OP ':'
1,8-1,9: NEWLINE '\n'
2,0-2,2: INDENT ' '
2,2-2,3: NAME 'x'
2,4-2,5: OP '='
2,6-2,7: NUMBER '0'
2,7-2,8: NEWLINE '\n'
4,2-4,3: NL '' <-- This used to be a NEWLINE
5,0-5,0: DEDENT ''
5,0-5,0: ENDMARKER ''
I tend to believe that the previous NEWLINE
was correct, but I'm not sure. Keep in mind, this breaks some tests on IPython. What do you think?