Options.__init__(): Annotate __allowed_keys as Any

mypy 2.4.0 infers the attribute from the None assignment in __init__() and
then flags the right operand of the and check in __parse__() as unreachable
code, failing make check.

The attribute is only ever assigned None, so annotate it as Any and keep
the runtime behaviour unchanged.

Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.5.2
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-11-13 14:40:14 +01:00
commit c679505053
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61

View file

@ -126,7 +126,7 @@ class Options: # export
true_val: Any = True
) -> None:
self.__true_val = true_val
self.__allowed_keys = None
self.__allowed_keys: Any = None
self.__delimiter = delimiter
self.__data = (
self.__class__.OrderedData()