You are viewing a single comment's thread. Return to all comments →
An easy way to save memory is to use __slots__ on your objects.
__slots__
For example:
class Node: __slots__ = ['size', 'children'] def __init__(self): self.size = 0 self.children = {}
Tries: Contacts
You are viewing a single comment's thread. Return to all comments →
An easy way to save memory is to use
__slots__
on your objects.For example: