Python builtin list memory allocation library
Project description
list-reserve
Python builtin list memory allocation library.
Getting it
pip install list_reserve
capacity
Return allocated list memory size.
from list_reserve import capacity
l = [1, 2, 3]
print(capacity(l)) # 3
reserve
Reserve list memory.
from list_reserve import reserve, capacity
l = []
reserve(l, 10)
print(len(l)) # 0
print(capacity(l)) # 10
shrink_to_fit
since 0.1.0
shrink to fit list capacity.
from list_reserve import capacity, shrink_to_fit
l = list(range(100))
print(capacity(l)) # 118
shrink_to_fit(l)
print(capacity(l)) # 100
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
list_reserve-0.3.2.tar.gz
(3.4 kB
view details)
File details
Details for the file list_reserve-0.3.2.tar.gz
.
File metadata
- Download URL: list_reserve-0.3.2.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b766656d31f6e46f30cdb5e9af754b8a3d70d59342b5333728f8c57c8eec8454 |
|
MD5 | 875acd04f53e1364fd96024dce0efe85 |
|
BLAKE2b-256 | 75386c5ea7e930baf25c9c54f304f3c87c872af6b14e23552cbc9643a87bfdad |