Assigning to an attribute which is not defined in the class slots will raise an error. It is recommended to add the name in the class slots. Not preferred: python class E: __slots__ = "foo" def __init__(self): self.not_foo = "Not foo" self.not_bar = "Not Bar" Preferred: ```python class E: …
Occurrences
There are 8 occurrences of this issue in the repository.
Description
Assigning to an attribute which is not defined in the class slots will raise an error. It is recommended to add the name in the class slots. Not preferred:
python class E: __slots__ = "foo" def __init__(self): self.not_foo = "Not foo" self.not_bar = "Not Bar"
Preferred: ```python class E: …Occurrences
There are 8 occurrences of this issue in the repository.
See all occurrences on DeepSource → deepsource.io/gh/argo0n/NograBot/issue/PYL-E0237/occurrences/