# list-reserve
Python builtin list memory allocation library.
[![PyPI - License](https://img.shields.io/pypi/l/list_reserve)](https://pypi.org/project/list-reserve/)
![Test](https://github.com/ChanTsune/list-reserve/workflows/Test/badge.svg)
[![PyPI](https://img.shields.io/pypi/v/list_reserve)](https://pypi.org/project/list-reserve/)
[![Downloads](https://pepy.tech/badge/list-reserve)](https://pepy.tech/project/list-reserve)
## Getting it
```bash
pip install list_reserve
```
### capacity
Return allocated list memory size.
```py
from list_reserve import capacity
l = [1, 2, 3]
print(capacity(l)) # 3
```
### reserve
Reserve list memory.
```py
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.
```py
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
[MIT License](./LICENSE)
Raw data
{
"_id": null,
"home_page": "https://github.com/ChanTsune/list-reserve",
"name": "list-reserve",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "list extension memory reserve capacity",
"author": "ChanTsune",
"author_email": "yshegou@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/75/38/6c5ea7e930baf25c9c54f304f3c87c872af6b14e23552cbc9643a87bfdad/list_reserve-0.3.2.tar.gz",
"platform": null,
"description": "# list-reserve\n\nPython builtin list memory allocation library. \n\n[![PyPI - License](https://img.shields.io/pypi/l/list_reserve)](https://pypi.org/project/list-reserve/)\n![Test](https://github.com/ChanTsune/list-reserve/workflows/Test/badge.svg)\n[![PyPI](https://img.shields.io/pypi/v/list_reserve)](https://pypi.org/project/list-reserve/)\n[![Downloads](https://pepy.tech/badge/list-reserve)](https://pepy.tech/project/list-reserve)\n\n## Getting it\n\n```bash\npip install list_reserve\n```\n\n### capacity\n\nReturn allocated list memory size.\n\n```py\nfrom list_reserve import capacity\n\nl = [1, 2, 3]\nprint(capacity(l)) # 3\n```\n\n### reserve\n\nReserve list memory.\n\n```py\nfrom list_reserve import reserve, capacity\n\nl = []\nreserve(l, 10)\n\nprint(len(l)) # 0\n\nprint(capacity(l)) # 10\n```\n\n### shrink_to_fit\n\n*since 0.1.0* \nshrink to fit list capacity.\n\n```py\nfrom list_reserve import capacity, shrink_to_fit\n\nl = list(range(100))\n\nprint(capacity(l)) # 118\n\nshrink_to_fit(l)\n\nprint(capacity(l)) # 100\n```\n\n## License\n\n[MIT License](./LICENSE)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python builtin list memory allocation library",
"version": "0.3.2",
"project_urls": {
"Homepage": "https://github.com/ChanTsune/list-reserve"
},
"split_keywords": [
"list",
"extension",
"memory",
"reserve",
"capacity"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "75386c5ea7e930baf25c9c54f304f3c87c872af6b14e23552cbc9643a87bfdad",
"md5": "875acd04f53e1364fd96024dce0efe85",
"sha256": "b766656d31f6e46f30cdb5e9af754b8a3d70d59342b5333728f8c57c8eec8454"
},
"downloads": -1,
"filename": "list_reserve-0.3.2.tar.gz",
"has_sig": false,
"md5_digest": "875acd04f53e1364fd96024dce0efe85",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3388,
"upload_time": "2023-08-11T08:35:21",
"upload_time_iso_8601": "2023-08-11T08:35:21.164375Z",
"url": "https://files.pythonhosted.org/packages/75/38/6c5ea7e930baf25c9c54f304f3c87c872af6b14e23552cbc9643a87bfdad/list_reserve-0.3.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-11 08:35:21",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ChanTsune",
"github_project": "list-reserve",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "list-reserve"
}