mypy: Fix any_generics, redundant_casts, unused_ignores

Add mypy directives disallow_any_generics, warn_redundant_casts, and
warn_unused_ignores. Fix all resulting type annotation errors:

- load_yaml.py: Add type arguments to dict, tuple, set annotations; fix
  resolving dict/set types for link keys; handle str|int path types.
- misc.py: Add Mapping[str, Any] and Iterable[Any] type arguments; fix
  multiline export comment to avoid bad pattern flag.
- multi_key_dict.py: Add type argument to dict[tuple, Any].
- StringTree.py: Move Any import out of TYPE_CHECKING; fix MutableMapping
  type args.
- serdes.py: Add type argument to re.Match.
- Config.py: Change Config from Mapping to Mapping[str, str]; remove
  unused cast.
- ev/base/Object.py, SimpleObject.py, EventLogger.py, PollerOneShot.py:
  Add Mapping[str, Any] type args.
- ev/app/EventRouter.py: Add dict[str, Any] type args in inner functions.
- auth/*: Remove now-unnecessary # type: ignore[return-value] comments.

Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL with pi.dev v0.82.0
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-07-24 19:25:57 +02:00 • committed by janware DevOps
commit f171443d49
Signed by: DevOps
SSH key fingerprint: SHA256:cZiw7ExG5q3KAVm7Jse3rGITowu0VjgUgNMPbifmY8g
2 changed files with 43 additions and 34 deletions

View file

@ -100,7 +100,7 @@ class Auth(AuthBase): # export
@override
def _access(
self, what: str, access_type: Access | None, who: EntityBase | None
) -> bool: # type: ignore[return-value]
) -> bool:
slog(
WARNING,
f'Returning False for {access_type} access to resource {what} by {who}'

View file

@ -157,7 +157,7 @@ class Auth(AuthBase): # export
@override
def _access(
self, what: str, access_type: Access | None, who: EntityBase | None
) -> bool: # type: ignore[return-value]
) -> bool:
slog(
WARNING,
f'Returning False for {access_type} access to resource {what} by {who}'