def _inverse_arg(self, arg): if arg.startswith('--'): if arg.startswith('--no-'): raise BooleanOptionNameWithNo(self.scope, arg) return '--no-{}'.format(arg[2:]) else: return None
def _inverse_arg(self, arg: str) -> Optional[str]: if not arg.startswith("--"): return None if arg.startswith("--no-"): raise BooleanOptionNameWithNo(self.scope, arg) return f"--no-{arg[2:]}"