PySortedSet
PySortedSet is a data type supporting a sorted set which is aware of indices.
Installation
pip install PySortedSet
Usage
To use the library install it using the command shown in "Installation" section. Then, read the instructions below regarding how to use operations with Apfloat.
Length
'len()' function can be called with a PySortedSet as the parameter. It gets the number of elements in the PySortedSet.
Input: len(PySortedSet([1, 4, 5])) Output: 3
Contains
Input: 5 in PySortedSet([5, 6, 2]) Output: True
Union
Input: PySortedSet([5, 6, 2]) + PySortedSet([5, 3]) Output: PySortedSet([2, 3, 5, 6])
Intersection
Input: PySortedSet([5, 6, 2]) & PySortedSet([5, 3]) Output: PySortedSet([5])
Difference
Input: PySortedSet([5, 6, 2]) - PySortedSet([5, 3]) Output: PySortedSet([6, 2])
Get Element at Index
Input:
a: PySortedSet = PySortedSet([5, 6, 2]) print(a[2])
Output: 6
Set Element at Index
Input:
a: PySortedSet = PySortedSet([5, 6, 2]) a[2] = 1 print(a)
Output: {1, 2, 5}
Add Element
Input:
a: PySortedSet = PySortedSet([5, 6, 2]) a.add(1) print(a)
Output: {1, 2, 5, 6}
Remove Element
Input:
a: PySortedSet = PySortedSet([5, 6, 2]) a.remove(5) print(a)
Output: {2, 6}
Pop Element
a: PySortedSet = PySortedSet([5, 6, 2]) a.pop(0) print(a)
Output: {5, 6}
Checking for Equality
Input: PySortedSet([5, 6, 2]) == {2, 5, 6} Output: True
Release files for PySortedSet 1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| PySortedSet-1.2.tar.gz | 3.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| PySortedSet-1.2-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 8.8 kB
Release files / PySortedSet-1.2.tar.gz
| Download URL | PySortedSet-1.2.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d76722d9d63e98da978234a6c27b59d4cc474827a2014994ca912f5fb3735b31
|
|
BLAKE2b-256 checksum How to use checksums |
763d1233b868b950b58e0c6abf4f7a71a0245524459a01487bdaa11810dcdc8e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.4
|
Release files / PySortedSet-1.2-py2-none-any.whl
| Download URL | PySortedSet-1.2-py2-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
53d64359f95884bea457337d3b5e39a1d017ba4b9f09e5e4f070843124a32990
|
|
BLAKE2b-256 checksum How to use checksums |
1f2acbdf211fa906f011b4a3b917edb514b4022a6d9175d998b00b21349b0725
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.4
|