From 12957db90f6eeb04d8273d534057dfb1e5ecb977 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Mon, 30 Aug 2021 19:08:10 +0200 Subject: [PATCH] Options: implement __eq__ assert for possible checks --- Options.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Options.py b/Options.py index 620e8c7f..1a7faf02 100644 --- a/Options.py +++ b/Options.py @@ -149,8 +149,10 @@ class Choice(Option): def __eq__(self, other): if type(other) == str: + assert other in self.options return other == self.current_key elif type(other) == int: + assert other in self.name_lookup return other == self.value elif type(other) == bool: return other == bool(self.value)