jw-python/src
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jan Lindemann af185c60f9
Config: Derive from Mapping and add @override
Derive Config from collections.abc.Mapping to formally declare it as
a read-only mapping interface. Implement the three abstract methods:

  - __getitem__(): delegates to get(), raises KeyError if missing
  - __iter__(): iterates over config keys (delegated to __conf)
  - __len__(): returns number of top-level keys

Add @override to __getitem__(), __iter__(), and __len__(). The get()
method does not get @override — Mapping.get() uses generic overloads
with Any-typed parameters that are incompatible with Config.get()’s
specific str-typed signature. While Config.get() is Liskov-safe
(contravariant args, covariant return), mypy flags the mismatch on
the def line. A targeted "# type: ignore[override]" suppresses only
this one false positive without disabling override checking for the
rest of the module.

Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL with pi.dev v
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-08-12 23:10:12 +00:00
..
python Config: Derive from Mapping and add @override 2026-08-12 23:10:12 +00:00
Makefile jwutils: Move to jwutils -> jw.util 2026-06-11 23:10:25 +00:00