mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-25 18:25:37 +07:00
Update PyPropertyAccessInspection to check writing to class attribute in case of __slots__ in class
15 lines
290 B
Python
15 lines
290 B
Python
class B(object):
|
|
__slots__ = ['f', 'b']
|
|
|
|
# ValueError: 'attr' in __slots__ conflicts with class variable
|
|
# This is not responsibility of current inspection
|
|
class C(B):
|
|
attr = 'baz'
|
|
__slots__ = ['attr', 'bar']
|
|
|
|
C.attr = 'spam'
|
|
print(C.attr)
|
|
|
|
c = C()
|
|
c.attr = 'spam'
|
|
print(c.attr) |