Restore a HistoryItem from a dictionary. :param source_dict: source data dictionary (generated using to_dict()) :return: HistoryItem object :raises KeyError: if source_dict is missing required elements
(source_dict: dict[str, Any])
| 121 | |
| 122 | @staticmethod |
| 123 | def from_dict(source_dict: dict[str, Any]) -> "HistoryItem": |
| 124 | """Restore a HistoryItem from a dictionary. |
| 125 | |
| 126 | :param source_dict: source data dictionary (generated using to_dict()) |
| 127 | :return: HistoryItem object |
| 128 | :raises KeyError: if source_dict is missing required elements |
| 129 | """ |
| 130 | statement_dict = source_dict[HistoryItem._statement_field] |
| 131 | return HistoryItem(Statement.from_dict(statement_dict)) |
| 132 | |
| 133 | |
| 134 | class History(list[HistoryItem]): |