cpython
cpython copied to clipboard
Bad indentation after pasting code in interactive interpreter
Bug report
Bug description:
In the interactive interpreter it is not possible to simply insert function definitions from the clipboard, because each line of the function body is indented compared to the previous one.
If I copy the function definition:
def f():
x = 1
x = 2
to the clipboard and paste it into the interactive interpreter, I get
>>> def f():
... x = 1
... x = 2
File "<unknown>", line 3
x = 2
IndentationError: unexpected indent
>>>
CPython versions tested on:
3.13
Operating systems tested on:
Windows