# 智能键设置：Python

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/zh-cn/help/idea/llms.txt).

> **TL;DR**
> `文件 | 设置 | 编辑器 | 常规 | 智能按键 | Python`  适用于 Windows 和 Linux
>
>
>
> `%instance% | 设置 | 编辑器 | 常规 | 智能按键 | Python`  适用于 macOS
>
>
>
> `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) !["设置"图标](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.settings.svg)

使用此设置页面配置 Python 中的输入辅助功能。

有关 IntelliJ IDEA 中 Python 支持的更多信息，请参见 [Python 语言支持](python.html)。

|  条目  |  描述  |
| --- | --- |
|  对粘贴的行进行智能缩进  |  默认情况下，选中此选项时，IntelliJ IDEA 会在插入代码片段时遵循 PEP 8 缩进规则。   ![对粘贴的行进行智能缩进](https://resources.jetbrains.com/help/img/idea/2026.3/py_smart_key_indent.png)  |
|  使用括号而非反斜杠进行换行  |  选中此选项（默认情况下），IntelliJ IDEA 会将当前表达式括在括号中，以保持语句的完整性，当您按下 `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (NetBeans), `Enter` (Eclipse), `⏎` (Eclipse (macOS)) 并拆分它时。   ![在语句中按 Enter 键时用括号包装表达式](https://resources.jetbrains.com/help/img/idea/2026.3/py_smart_key_wrap.png)  |
|  定义方法时插入 'self'  |  选中此选项（默认情况下），IntelliJ IDEA 会在方法声明中添加  `self` 。   ![定义方法时插入 'self'](https://resources.jetbrains.com/help/img/idea/2026.3/py_smart_key_self.png)  |
|  在文档注释存根中插入类型占位符。  |  选择此选项，IntelliJ IDEA 会在文档注释中创建一个输入类型的占位符。 所有文档字符串格式都添加了占位符，但   普通   除外。   ![在文档注释存根中插入类型占位符](https://resources.jetbrains.com/help/img/idea/2026.3/py_smart_key_docstring.png)  |

