- Wed 29 May 2024
- Python
- Marius Mather
Reduce Python's memory use with slots
Python's classes are pretty flexible by default - you usually initialize them with some attributes, but you can attach new attributes to them after creation: class DefaultPoint: def __init__(self, x …