以前如果直接在 REPL 中粘贴代码,会出现这样的情况,因为缩进错误找出无法运行At the REPL, a tab will now insert an indent when it follows whitespace, and auto-indent is automatically disabled if a space or tab follows an auto-indent. This means that Python code can be pasted into the standard REPL without messing up the indentation.
在 REPL 中,制表符现在会在空格后面插入缩进,如果空格或制表符跟在自动缩进后面,自动缩进会自动禁用。 这意味着可以将 Python 代码粘贴到标准 REPL 中而不会弄乱缩进。
代码: 全选
>>> sum = 0
>>> for i in range(10):
... sum += i
... print(sum)
而现在就会变为
代码: 全选
>>> sum = 0
>>> for i in range(10):
... sum += i
... print(sum)