All Purpose Set
Table of Contents
What is it?
- A set which doesn't require hashable contents
Why create it?
-
I often have a need to store non-hashable contents in a set. For example storing a dict isn't possible with the builtin set.
# doesn't work someDict = { "key": "value" } someSet = { someDict }
Simple usage
from all_purpose_set import ApSet
someDict = { "key": "value" }
someSet = ApSet([someDict])
print(someDict in someSet) # prints True
See also
Api
Note: This api is young and subject to change quite a bit. There also may be functionality present in the builtin set which this set doesn't cover. I'm willing to add it so please just raise a github issue or PR with details.
class ApSet([a list])
- all methods return
selfunless specified otherwise - iterates in the order of insertion
- currently the internal methods implemented are
- __contains__
- __iter__
- __len__
add(something)
clear()
has(something) => bool
- a function alternative to
key in aSet
remove(something)
- raises a
KeyErrorif the element doesn't exist
Test
#
# you must have poetry installed
#
$ poetry shell
$ poetry install
$ python runTests.py
Metadata
Release files for all-purpose-set 0.1.10
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 |
|---|---|---|---|---|
| all_purpose_set-0.1.10.tar.gz | 178.2 kB | Without provenance | Details for all_purpose_set-0.1.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| all_purpose_set-0.1.10-py3-none-any.whl | Python 3 | none | any | Details for all_purpose_set-0.1.10-py3-none-any.whl |
Total release size: 386.9 kB
Release files / all_purpose_set-0.1.10.tar.gz
| Download URL | all_purpose_set-0.1.10.tar.gz |
|---|---|
| Size | 178.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
abc26982d71973a1cd27c20eb1e889e228fe26804a5deeffab00ff3cd9dfd6d2
|
|
BLAKE2b-256 checksum How to use checksums |
7104c14bf8be22f2febc64d34d2789aaad36f1c14012fc32d6059ddcb053a144
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.15 CPython/3.7.1 Linux/5.1.2-arch1-1-ARCH
|
Release files / all_purpose_set-0.1.10-py3-none-any.whl
| Download URL | all_purpose_set-0.1.10-py3-none-any.whl |
|---|---|
| Size | 208.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6ea32c0ca5937e22753b4f2d9ac7633fff47c605095f0ff58ae076fc5297cb09
|
|
BLAKE2b-256 checksum How to use checksums |
5ffa79ddcc203fe515cab78cc44b637257ca2a20d5e452129da453ae152225fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.15 CPython/3.7.1 Linux/5.1.2-arch1-1-ARCH
|
Security for all-purpose-set 0.1.10
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.