
代码里一直这么写的
class MyClass(object): __slots__ = ['xx', ] def __init__(self): self.xx = 1 但是刚才 用了 pycharm 2016.2 后 pycharm 提示说
'MyClass' object attribute 'xx' is read-only
这是什么意思? 既然是 read-only 为何代码一直能跑? 以前版本的 pycharm 没这个提示。
如何消除这个提示?
1 LPeJuN6lLsS9 2016-07-26 12:07:12 +08:00 把设置>编辑器>inspections 里的 access to properties 关掉试试?我的 py3.4 没有出现,但重点是为什么会出现这提示 |
2 yueyoum OP |
4 yueyoum OP |