StaticTypedList
StaticTypedList is a data type supporting a list of one type of element (and its subtypes) like Java List objects.
Installation
pip install StaticTypedList
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 StaticTypedList.
Length
'len()' function can be called with a StaticTypedList as the parameter. It gets the number of elements in the StaticTypedList.
Input: len(StaticTypedList([4, 5, 3])) Output: 3
Contains
Input: 5 in StaticTypedList([5, 6, 2]) Output: True
Get Item at Index
Input:
a: StaticTypedList = StaticTypedList([5, 6, 2]) print(a[1])
Output: 6
Set Item at Index
Input:
a: StaticTypedList = StaticTypedList([5, 6, 2]) a[1] = 1 print(a)
Output: [5, 1, 2]
Append Element
Input:
a: StaticTypedList = StaticTypedList([5, 6, 2]) a.append(1) print(a)
Output: [5, 6, 2, 1]
Insert Element
Input:
a: StaticTypedList = StaticTypedList([5, 6, 2]) a.insert(1, 3) print(a)
Output: [5, 3, 6, 2]
Remove Element
Input:
a: StaticTypedList = StaticTypedList([5, 6, 2]) a.remove(6) print(a)
Output: [5, 2]
Pop Element
Input:
a: StaticTypedList = StaticTypedList([5, 6, 2]) a.pop(1) print(a)
Output: [5, 2]
Extend Lists
Input:
a: StaticTypedList = StaticTypedList([5, 6, 2]) b: StaticTypedList = StaticTypedList([2, 7]) a.extend(b) print(a)
Output: [5, 6, 2, 2, 7]
Count Number of Occurrences of Element
Input:
a: StaticTypedList = StaticTypedList([5, 6, 2, 7, 2, 3, 2]) print(a.count(2))
Output: 3
Get Index of Element
Input:
a: StaticTypedList = StaticTypedList([1, 7, 3, 7, 5]) print(a.index(3))
Output: 2
Sort
Input:
a: StaticTypedList = StaticTypedList([3, 2, 6, 7, 1]) a.sort() print(a)
Output: [1, 2, 3, 6, 7]
Clear
Input:
a: StaticTypedList = StaticTypedList([3, 2, 6, 7, 1]) a.clear() print(a)
Output: []
Checking for Equality
Input: StaticTypedList([2, 6, 7, 3]) == [2, 6, 7, 3] Output: True
Release files for StaticTypedList 1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| StaticTypedList-1.tar.gz | 3.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| StaticTypedList-1-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 9.3 kB
Release files / StaticTypedList-1.tar.gz
| Download URL | StaticTypedList-1.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f7fd17ed562a7a00c55e4030fbce64327abb8f2497a49dcc0642b049c010bb7e
|
|
BLAKE2b-256 checksum How to use checksums |
fcd6ceaf535681597aab5fa2eb202814327fc496e72aa879a2c1a4c9fbc8a3fd
|
| 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 / StaticTypedList-1-py2-none-any.whl
| Download URL | StaticTypedList-1-py2-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
9284c1d93b3ae85da895f656d57d57f6e473170fcc8ca579857657b486d13ee3
|
|
BLAKE2b-256 checksum How to use checksums |
d216a385dd7c28028d44a0c0535e6dfeb7aacf6fd0ff4422f255d14d5948bbb6
|
| 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
|