From 9894d0672f5708b784661527ff026d9a1ee64d72 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Thu, 6 Jan 2022 17:03:47 +0100 Subject: [PATCH] Options: allow Choices to be hashed --- Options.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Options.py b/Options.py index 2bf329f1..a5ef5f9c 100644 --- a/Options.py +++ b/Options.py @@ -186,6 +186,8 @@ class Choice(Option): else: raise TypeError(f"Can't compare {self.__class__.__name__} with {other.__class__.__name__}") + __hash__ = Option.__hash__ # see https://docs.python.org/3/reference/datamodel.html#object.__hash__ + class Range(Option, int): range_start = 0