pyaiml21.session.bounded_list.BoundedList¶
- class pyaiml21.session.bounded_list.BoundedList(maxsize: Optional[int] = None)[source][source]¶
Represents a bounded list, a list with predefined max size.
Methods
Add new item to the list, possibly overwriting the oldest item.
Attributes
Get the number of items currently in the list.
Return True if the list is infinite.
Maximal size of the list, or None for infinite list.
- add(item: Any) None[source][source]¶
Add new item to the list, possibly overwriting the oldest item.
Place item into the list, if the capacity is more than maxsize and list is finite, overwrite the oldest item on the list.
Implementation note: change if allowed removing
- Parameters
item – item to place into the list