A list that will ignore case when searching. This class is passed to the `choices` argument of `argparse.add_arguments` through the `helpful` wrapper. It is necessary due to special handling of command line arguments by `set_by_cli` in which the `type_func` is not applied.
| 152 | args_or_config.ip_addresses.append(ip_address) |
| 153 | |
| 154 | class CaseInsensitiveList(list): |
| 155 | """A list that will ignore case when searching. |
| 156 | |
| 157 | This class is passed to the `choices` argument of `argparse.add_arguments` |
| 158 | through the `helpful` wrapper. It is necessary due to special handling of |
| 159 | command line arguments by `set_by_cli` in which the `type_func` is not applied.""" |
| 160 | def __contains__(self, element: object) -> bool: |
| 161 | if not isinstance(element, str): |
| 162 | return False |
| 163 | return super().__contains__(element.lower()) |
| 164 | |
| 165 | |
| 166 | def _user_agent_comment_type(value: str) -> str: |
no outgoing calls
no test coverage detected