Automatically Extending List
Getting started
List extending automatically to the maximum requested length.
Added indices are filled with None by default.
>>> from defaultlist import defaultlist
>>> l = defaultlist()
>>> l
[]
>>> l[2] = "C"
>>> l
[None, None, 'C']
>>> l[4]
>>> l
[None, None, 'C', None, None]
Slices and negative indices are supported likewise
>>> l[1:4]
[None, 'C', None]
>>> l[-3]
'C'
Simple factory functions can be created via lambda.
>>> l = defaultlist(lambda: 'empty')
>>> l[2] = "C"
>>> l[4]
'empty'
>>> l
['empty', 'empty', 'C', 'empty', 'empty']
Installation
Installing it is pretty easy:
pip install defaultlist
Metadata
Release files for defaultlist 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| defaultlist-1.2.0.tar.gz | 4.6 kB | Without provenance | Details for defaultlist-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| defaultlist-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for defaultlist-1.2.0-py3-none-any.whl |
Total release size: 9.0 kB
Release files / defaultlist-1.2.0.tar.gz
| Download URL | defaultlist-1.2.0.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2a023dedd77cb66b09cfe24c5587bae96f028e613157a871c8172e205ba6961f
|
|
BLAKE2b-256 checksum How to use checksums |
0f6869012445ee167dedf704d8c385249efa3ec139b9e2b6b302206959b8eb65
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
pdm/2.24.2 CPython/3.13.3 Linux/6.11.0-1014-azure
|
Release files / defaultlist-1.2.0-py3-none-any.whl
| Download URL | defaultlist-1.2.0-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f508ec4481087001c35b27c61a1f347b0bccdb9161df7dd64d4cefc8c580c115
|
|
BLAKE2b-256 checksum How to use checksums |
4b5891ad13c854690c4d2b9f8ce18719acfa53675821a14cf2424fdda809cfed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
pdm/2.24.2 CPython/3.13.3 Linux/6.11.0-1014-azure
|
Security for defaultlist 1.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.