Cast a single item from a string Evaluated when parsing CLI configuration from a string
(self, s: str, index: int)
| 3809 | super(Container, self).__init__(klass=self.klass, args=args, **kwargs) |
| 3810 | |
| 3811 | def item_from_string(self, s: str, index: int) -> t.Any: # type:ignore[override] |
| 3812 | """Cast a single item from a string |
| 3813 | |
| 3814 | Evaluated when parsing CLI configuration from a string |
| 3815 | """ |
| 3816 | if not self._traits or index >= len(self._traits): |
| 3817 | # return s instead of raising index error |
| 3818 | # length errors will be raised later on validation |
| 3819 | return s |
| 3820 | return self._traits[index].from_string(s) |
| 3821 | |
| 3822 | def validate_elements(self, obj: t.Any, value: t.Any) -> t.Any: |
| 3823 | if not self._traits: |
nothing calls this directly
no test coverage detected