Encode the state name into a formatted var. Args: value: The value to encode the state name into. Returns: The encoded var.
(value: Var)
| 176 | |
| 177 | |
| 178 | def _encode_var(value: Var) -> str: |
| 179 | """Encode the state name into a formatted var. |
| 180 | |
| 181 | Args: |
| 182 | value: The value to encode the state name into. |
| 183 | |
| 184 | Returns: |
| 185 | The encoded var. |
| 186 | """ |
| 187 | if value._var_data: |
| 188 | return f"<nextpy.Var>{value._var_data.json()}</nextpy.Var>" + str(value) |
| 189 | return str(value) |
| 190 | |
| 191 | |
| 192 | def _decode_var(value: str) -> tuple[VarData | None, str]: |