(self, key)
| 56 | raise AttributeError(f"No flag attribute '{attr}'") |
| 57 | |
| 58 | def __getitem__(self, key): |
| 59 | if key in SHORTHAND_TO_FLAGS.keys(): |
| 60 | key = SHORTHAND_TO_FLAGS[key] |
| 61 | if key in FLAGS: |
| 62 | try: |
| 63 | return self._flag_to_value[key] |
| 64 | except KeyError as e: |
| 65 | raise NotImplementedError(f"{key=}") from e |
| 66 | else: |
| 67 | raise KeyError(f"No flag key '{key}'") |
| 68 | |
| 69 | def __setattr__(self, attr, value): |
| 70 | if attr.islower() and attr.upper() in FLAGS: |