graviti.utility.typing
#
Graviti customized types.
Module Contents#
Classes#
Typehint for nested dict. |
Functions#
|
Check the type of the argument. |
Attributes#
- class graviti.utility.typing.NestedDict[source]#
Bases:
typing_extensions.Protocol
[_K
,_V
]Typehint for nested dict.
- items(self)[source]#
Return (key, value) pairs of the dict.
- Return type
AbstractSet[Tuple[_K, Union[NestedDict[_K, _V], _V]]]
- setdefault(self, key, default)[source]#
Get the value of the key if exists, else set the value as default and return.
- Parameters
key (_K) – The key.
default (Union[NestedDict[_K, _V], _V]) – The default value to set if the key does not exist.
- Return type
Union[NestedDict[_K, _V], _V]