(self, attr)
| 3145 | return self.__class__(int(self), self.names) |
| 3146 | |
| 3147 | def __getattr__(self, attr): |
| 3148 | # type: (str) -> Any |
| 3149 | if attr in self.__slots__: |
| 3150 | return super(FlagValue, self).__getattribute__(attr) |
| 3151 | try: |
| 3152 | if self.multi: |
| 3153 | return bool((2 ** self.names.index(attr)) & int(self)) |
| 3154 | return all(bool((2 ** self.names.index(flag)) & int(self)) |
| 3155 | for flag in attr) |
| 3156 | except ValueError: |
| 3157 | if '_' in attr: |
| 3158 | try: |
| 3159 | return self.__getattr__(attr.replace('_', '-')) |
| 3160 | except AttributeError: |
| 3161 | pass |
| 3162 | return super(FlagValue, self).__getattribute__(attr) |
| 3163 | |
| 3164 | def __setattr__(self, attr, value): |
| 3165 | # type: (str, Union[List[str], int, str]) -> None |
nothing calls this directly
no test coverage detected