我正在使用 PyCharm IDE;我喜欢它为我所做的所有工作。在我学习python的过程中发现它非常强大。它包含有关变量名称、拼写错误等的所有提示...
但是现在我有点困惑。将 PyCharm 与 IronPython 2.7 结合使用时,Pycharm 在定义类方法时向我提供信息。
Shadows built-in name 'self'
在我看来,该类(class)的一切都很好:
class A(object):
"""
Cheers Stackoverflowers
"""
def __init__(self, x):
self.x = x + 2
def calculate_something(self, y):
self.x = y * 2
但我希望在编程时 100% 正确。如果在类定义中有更多正确的方法来定义方法,我想知道在哪里可以找到相关信息。
截图:
请您参考如下方法:
这是一个 IronPython 错误
使用 CPython 时不会发生这种情况
谢谢@yole
