python - Spyder IDE 中的 "Simple auto-indentation"模式?

标签 python spyder auto-indent

在 Python IDE Spyder 中,我经常遇到按 <enter> 时自动缩进的问题,尽管已经禁用了尽可能多的缩进功能(工具 → 首选项 → 编辑器 → 高级设置)。这包括使用嵌套括号时不希望的深缩进,以及在少数情况下的彻底错误。一个例子是

if True: # <enter>, <tab>
    x = f(
            a = lengthy_expression, # automatic indentation undesirably deep
            b = lengthy_expression)

或从 Spyder 3.1.1 开始

assert f(x) == 1
          wrongly_indented_statement()

我更喜欢自动缩进来简单地保留上一行的缩进级别,为用户留下多行表达式的额外缩进,例如

if True: # <enter>, <tab>
    x = f( # <enter>, <tab>
        a = lengthy_expression, # <enter> 
        b = lengthy_expression) # <enter>

spyder 中有这样的“简单自动缩进”模式吗?

最佳答案

(这里是 Spyder 开发人员)不,没有。我们将尝试在下一个版本(3.1.3 或 3.1.4)中修复这些错误

关于python - Spyder IDE 中的 "Simple auto-indentation"模式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41937371/

相关文章:

python - 根据条件计算出现次数并保存在新列中

python - 如何在 Python 中解决非线性规划问题

Python 2.7 : Unable to import matplotlib. pyplot

python - 模块未找到错误 : No module named 'pyLDAvis' in anaconda spyder

vim - 使用 == 时保留光标位置

javascript - 如何在 Aptana Studio 中自动缩进 JavaScript 代码?

matlab - 我可以让 MATLAB 在自动缩进时忽略一段代码吗?

python - 需要下载PDF,而不是网页内容

python - 获取一个 python 切片来反转字符串的一部分的顺序(交换字符串中的连续字符)?

python - Spyder 控制台关闭交互式 matplotlib 绘图