Construct a HumanData instance from a dict. Args: source_dict (dict, optional): A dict with items in HumanData fashion. Defaults to None. key_strict (bool, optional): Whether to raise error when setting unsupported keys
(cls,
source_dict: dict = None,
key_strict: bool = False)
| 176 | |
| 177 | @classmethod |
| 178 | def new(cls, |
| 179 | source_dict: dict = None, |
| 180 | key_strict: bool = False) -> _HumanData: |
| 181 | """Construct a HumanData instance from a dict. |
| 182 | |
| 183 | Args: |
| 184 | source_dict (dict, optional): |
| 185 | A dict with items in HumanData fashion. |
| 186 | Defaults to None. |
| 187 | key_strict (bool, optional): |
| 188 | Whether to raise error when setting unsupported keys. |
| 189 | Defaults to False. |
| 190 | |
| 191 | Returns: |
| 192 | HumanData: |
| 193 | A HumanData instance. |
| 194 | """ |
| 195 | if source_dict is None: |
| 196 | ret_human_data = cls() |
| 197 | else: |
| 198 | ret_human_data = cls(source_dict) |
| 199 | ret_human_data.set_key_strict(key_strict) |
| 200 | return ret_human_data |
| 201 | |
| 202 | def get_key_strict(self) -> bool: |
| 203 | """Get value of attribute key_strict. |
no test coverage detected