.. | ||
private | ||
mem_test.py | ||
patterns.py | ||
README.md | ||
slots.rst | ||
vector2d_v0.py | ||
vector2d_v1.py | ||
vector2d_v2_fmt_snippet.py | ||
vector2d_v2.py | ||
vector2d_v3_prophash.py | ||
vector2d_v3_slots.py | ||
vector2d_v3.py |
A Pythonic Object
Sample code for Chapter 11 of Fluent Python 2e by Luciano Ramalho (O’Reilly, 2020)
The memtest.py script takes a module name in the command
line and loads it. Assuming the module defines a class named
Vector
, memtest.py creates a list with 10 million
instances, reporting the memory usage before and after the list is
created.