graviti.utility.attr
#
Attr related class.
Module Contents#
Classes#
A dict which allows for attr-style access of values. |
- class graviti.utility.attr.AttrDict[source]#
Bases:
_AttrDict
[_T
],Mapping
[str
,_T
]A dict which allows for attr-style access of values.
- get(self, key: str) Optional[_T] [source]#
- get(self, key: str, default: _D = ...) Union[_D, _T]
Return the value for the key if it is in the dict, else default.
- Parameters
key – The key for dict, which can be any immutable type.
default – The value to be returned if key is not in the dict.
- Returns
The value for the key if it is in the dict, else default.