Shadows built-in names “function” and “module” with PyCharm

前端 未结 2 1831
渐次进展
渐次进展 2021-01-17 14:20

I have the following Python code:

function = \"Developer\"
module = \"something\"
print(function + \" on \" + module)

With PyCharm 2017, I

2条回答
  •  生来不讨喜
    2021-01-17 14:43

    Per PY-8672, since March 2014 there is an ability to ignore certain names with this inspection. Open Settings, search "Shadowing built-ins", click on the inspection name, and use the Options section to add names the inspection should whitelist.

提交回复
热议问题