stp.utils.typed_key_dict
This module contains data structures to define TypedKeyDict.
Module Contents
Classes
A key that contains type information about the value. |
|
A dictionary with type information where the key encodes information about the |
Attributes
- stp.utils.typed_key_dict.ValueInterfaceT
- stp.utils.typed_key_dict.ValueConcreteT
- class stp.utils.typed_key_dict.TypedKey(cls: Type[ValueConcreteT])
Bases:
Generic
[ValueConcreteT
]A key that contains type information about the value.
- __slots__ = ['concrete_cls']
- value_t() Type[ValueConcreteT]
Returns the type of the value for this key. :return: The type of the value for this key.
- class stp.utils.typed_key_dict.TypedKeyDict
Bases:
Generic
[ValueInterfaceT
],collections.abc.MutableMapping
A dictionary with type information where the key encodes information about the subclass so that the correct subclass can be retrieved without an additional instanceof check.
- __slots__ = ['_dict']
- __len__() int
- __iter__()
- __contains__(item) bool