typedList

class Stoner.tools.typedList(*args: Any, **kargs: Any)[source]

Bases: collections.abc.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(other)

Extend the list and do some type checking.

index(search[, start, end])

Index works like a list except we support Python 3 optional parameters everywhere.

insert(index, obj)

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
extend(other: Iterable) None[source]

Extend the list and do some type checking.

index(search: Any, start: int = 0, end: Optional[int] = None) int[source]

Index works like a list except we support Python 3 optional parameters everywhere.

insert(index: int, obj: Any) None[source]

Insert an element and do some type checking.

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