string-dot-format-mixing-automatic (F525) 添加于 v0.0.139 · 相关问题 · 查看源码 派生自 Pyflakes 代码检查器。 作用 检查混用自动编号和手动编号的 str.format 调用。 为什么这不好? 在 str.format 调用中,混用自动编号和手动编号会在运行时引发 ValueError。 示例 "{0}, {}".format("Hello", "World") 建议改为 "{0}, {1}".format("Hello", "World") 或者 "{}, {}".format("Hello", "World") 参考 Python 文档:str.format