@@ -107,7 +107,7 @@ def type_name(tp):
107107 type_name (type (v ))))
108108
109109
110- def check_in_list (values , / , * , _print_supported_values = True , * *kwargs ):
110+ def check_in_list (values , / , ** kwargs ):
111111 """
112112 For each *key, value* pair in *kwargs*, check that *value* is in *values*;
113113 if not, raise an appropriate ValueError.
@@ -119,8 +119,6 @@ def check_in_list(values, /, *, _print_supported_values=True, **kwargs):
119119
120120 Note: All values must support == comparisons.
121121 This means in particular the entries must not be numpy arrays.
122- _print_supported_values : bool, default: True
123- Whether to print *values* when raising ValueError.
124122 **kwargs : dict
125123 *key, value* pairs as keyword arguments to find in *values*.
126124
@@ -148,9 +146,8 @@ def check_in_list(values, /, *, _print_supported_values=True, **kwargs):
148146 # the individual `val == values[i]` ValueError surface.
149147 exists = False
150148 if not exists :
151- msg = f"{ val !r} is not a valid value for { key } "
152- if _print_supported_values :
153- msg += f"; supported values are { ', ' .join (map (repr , values ))} "
149+ msg = (f"{ val !r} is not a valid value for { key } "
150+ f"; supported values are { ', ' .join (map (repr , values ))} " )
154151 raise ValueError (msg )
155152
156153
0 commit comments