MCPcopy
hub / github.com/reflex-dev/reflex / get_value

Method get_value

reflex/state.py:1956–1976  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 3

get_deltaMethod · 0.95
dictMethod · 0.95
test_get_valueFunction · 0.80

Calls

no outgoing calls

Tested by 1

test_get_valueFunction · 0.64