Construct a Dict from a Python mapping.
(self, input_dict: Mapping[K, V] | None = None)
| 672 | return _ffi_api.DeepCopy(self) |
| 673 | |
| 674 | def __init__(self, input_dict: Mapping[K, V] | None = None) -> None: |
| 675 | """Construct a Dict from a Python mapping.""" |
| 676 | list_kvs: list[Any] = [] |
| 677 | if input_dict is not None: |
| 678 | for k, v in input_dict.items(): |
| 679 | list_kvs.append(k) |
| 680 | list_kvs.append(v) |
| 681 | self.__init_handle_by_constructor__(_ffi_api.Dict, *list_kvs) |
| 682 | |
| 683 | def __getitem__(self, k: K) -> V: |
| 684 | """Return the value for key `k` or raise KeyError.""" |