Get the value stored in this string
(self, trait: TraitType[t.Any, t.Any])
| 406 | """ |
| 407 | |
| 408 | def get_value(self, trait: TraitType[t.Any, t.Any]) -> t.Any: |
| 409 | """Get the value stored in this string""" |
| 410 | s = str(self) |
| 411 | try: |
| 412 | return trait.from_string(s) |
| 413 | except Exception: |
| 414 | # exception casting from string, |
| 415 | # let the original string lie. |
| 416 | # this will raise a more informative error when config is loaded. |
| 417 | return s |
| 418 | |
| 419 | def __repr__(self) -> str: |
| 420 | return f"{self.__class__.__name__}({self._super_repr()})" |
no test coverage detected