typedList¶
- class Stoner.tools.typedList(*args: Any, **kargs: Any)[source]¶
Bases:
MutableSequence
Subclass list to make setitem enforce strict typing of members of the list.
Methods Summary
append
(value)S.append(value) -- append value to the end of the sequence
clear
()count
(value)extend
(values)Extend the list and do some type checking.
index
(value[, start, end])Index works like a list except we support Python 3 optional parameters everywhere.
insert
(index, value)Insert an element and do some type checking.
pop
([index])Raise IndexError if list is empty or index is out of range.
remove
(value)S.remove(value) -- remove first occurrence of value.
reverse
()S.reverse() -- reverse IN PLACE
Methods Documentation
- append(value)¶
S.append(value) – append value to the end of the sequence
- clear() None -- remove all items from S ¶
- count(value) integer -- return number of occurrences of value ¶
- index(value: Any, start: int = 0, end: Optional[int] = None) int [source]¶
Index works like a list except we support Python 3 optional parameters everywhere.
- pop([index]) item -- remove and return item at index (default last). ¶
Raise IndexError if list is empty or index is out of range.
- remove(value)¶
S.remove(value) – remove first occurrence of value. Raise ValueError if the value is not present.
- reverse()¶
S.reverse() – reverse IN PLACE