Load value from a single string
(self, s: str)
| 3524 | # to opt out of instance_init |
| 3525 | |
| 3526 | def from_string(self, s: str) -> T | None: |
| 3527 | """Load value from a single string""" |
| 3528 | if not isinstance(s, str): |
| 3529 | raise TraitError(f"Expected string, got {s!r}") |
| 3530 | try: |
| 3531 | test = literal_eval(s) |
| 3532 | except Exception: |
| 3533 | test = None |
| 3534 | return self.validate(None, test) |
| 3535 | |
| 3536 | def from_string_list(self, s_list: list[str]) -> T | None: |
| 3537 | """Return the value from a list of config strings |
nothing calls this directly
no test coverage detected