argo0n / NograBot

Discord.py bot written by Argon#0002
GNU General Public License v3.0
2 stars 1 forks source link

(PYL-E0237) Assigning to an attribute not defined in class `slots` #83

Closed argo0n closed 3 years ago

argo0n commented 3 years ago

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/

argo0n commented 3 years ago

image If you can't fix it then don't highlight it, it's correct anyways 🙄