Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
PyCharm 的代码检查是一个有用的工具,但有时它会出错。我知道您可以通过设置禁用所有类别的警告,但是如果您只想在特定行取消警告的特定实例怎么办?
1.Alt + Enter当光标站在有问题的地方时。
2. 从出现的弹出菜单中选择适当的条目。
3. 展开子菜单(点击右侧的小三角形.. 或直接按arrow right键盘上的键。
4.从那里选择“禁止声明” 。
最后,将在该行之前添加特殊注释,该注释将暂时关闭对下一条语句的特定检查。
这是它在 PhpStorm 中的样子(抱歉,我不是 PyCharm 或 Python 用户):