Get the value of a field (without proxying). The returned value will NOT track dirty state updates. Args: key: The key of the field. Returns: The value of the field. Raises: TypeError: If the key is not a string or MutableProxy.
(self, key: str)
| 1954 | self.dirty_substates = set() |
| 1955 | |
| 1956 | def get_value(self, key: str) -> Any: |
| 1957 | """Get the value of a field (without proxying). |
| 1958 | |
| 1959 | The returned value will NOT track dirty state updates. |
| 1960 | |
| 1961 | Args: |
| 1962 | key: The key of the field. |
| 1963 | |
| 1964 | Returns: |
| 1965 | The value of the field. |
| 1966 | |
| 1967 | Raises: |
| 1968 | TypeError: If the key is not a string or MutableProxy. |
| 1969 | """ |
| 1970 | if isinstance(key, str): |
| 1971 | if isinstance(val := getattr(self, key), MutableProxy): |
| 1972 | return val.__wrapped__ |
| 1973 | return val |
| 1974 | |
| 1975 | msg = f"Invalid key type: {type(key)}. Expected str." |
| 1976 | raise TypeError(msg) |
| 1977 | |
| 1978 | def dict( |
| 1979 | self, include_computed: bool = True, initial: bool = False, **kwargs |
no outgoing calls