Files
openide/python/testData/inspections/PyDunderSlotsInspection/inheritedClassAttrAssignmentAndOwnAndInheritedWithAttrSlotsPy2.py
2017-05-13 00:17:45 +03:00

13 lines
245 B
Python

class B(object):
attr = 'baz'
__slots__ = ['attr', 'b']
class C(B):
__slots__ = ['foo', 'bar']
C.attr = 'spam'
print(C.attr)
c = C()
<warning descr="'C' object attribute 'attr' is read-only">c.attr</warning> = 'spam'
print(c.attr)