OrderedTypedDict

class ipkiss3.all.OrderedTypedDict

Base class for (ordered) dicts with items of a given type.

Acts like any other dict but checks the type of an object when initializing or adding items to the dict. Exposes the OrderedDict API.

The item type is set by setting _item_type on the class. Checking is done with isinstance(), hence all objects of classes with _item_type as a base are accepted.

rename(old_key, new_key)

Changes the key of an item in the OrderedDict while keeping its position