Efficiently convert to plain dict. This method is faster than dict(self).
(self)
| 562 | return iter(self.to_dict()) |
| 563 | |
| 564 | def to_dict(self) -> dict[Key, Any]: |
| 565 | """Efficiently convert to plain dict. This method is faster than dict(self).""" |
| 566 | try: |
| 567 | return self._to_dict |
| 568 | except AttributeError: |
| 569 | out = self._to_dict = ensure_dict(self) |
| 570 | return out |
| 571 | |
| 572 | def keys(self) -> KeysView: |
| 573 | """Get all keys of all the layers. |