Files
openide/python/testData/inspections/PyPropertyAccessInspection/classAttrAssignmentAndOwnWithAttrAndInheritedSlotsPy3.py
T
Semyon Proshev 5ab55667c8 PY-12773 Fixed: Misleading warning for attribute assignment when a class has __slots__
Update PyPropertyAccessInspection to check writing to class attribute in case of __slots__ in class
2016-05-24 19:17:02 +03:00

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)