Daily Shaarli
December 8, 2022
x1.slot1 = 1
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Input In [3], in <module>
----> 1 x1.slot1 = 1
AttributeError: 'Example' object has no attribute 'slot1'Avoid them if you want to subclass variable length builtins like long, tuple, or str, and you want to add attributes to them.
Avoid them if you insist on providing default values via class attributes for instance variables.