Use slots where possible for a marginal memory save
This commit is contained in:
1 parent
0dc8313188
commit
4788ac8fbf
2 files changed
+5
-1
No files matched your search
@@ -25,6 +25,8 @@ def remove_dimensions(url: URLType) -> URLType:
|
||||
|
||||
|
||||
class Benefit:
|
||||
__slots__ = ("id", "name", "image_url")
|
||||
|
||||
def __init__(self, data: JsonType):
|
||||
benefit_data: JsonType = data["benefit"]
|
||||
self.id: str = benefit_data["id"]
|
||||
|
||||
Reference in new issue
Block a user