From 0aa08a835ebf766239265557a0f65dc6a6bc49f0 Mon Sep 17 00:00:00 2001 From: ms-alan <1472110+ms-alan@users.noreply.github.com> Date: Thu, 7 May 2026 00:05:39 +0800 Subject: [PATCH] fix(toolsets): use typing.Any instead of builtin any in get_distribution return type `Optional[Dict[str, any]]` annotated the value type with the builtin `any()` function rather than `typing.Any`; static checkers reject it and the intent is `Any`. Add `Any` to the typing import and fix the annotation (#2139). Re-authored to the PR author's GitHub noreply identity: the original commit carried an empty author email (misconfigured local git, not malice). Salvaged from PR #20812. --- toolset_distributions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolset_distributions.py b/toolset_distributions.py index 6f3ef71ddf..d9e6baae1f 100644 --- a/toolset_distributions.py +++ b/toolset_distributions.py @@ -6,7 +6,7 @@ A distribution maps toolset names to the % chance each is enabled for a prompt be a "+"-grouped compound ("browser+search") that rolls once for all members. """ -from typing import Dict, List, Optional +from typing import Any, Dict, List, Optional import random from toolsets import validate_toolset @@ -46,7 +46,7 @@ DISTRIBUTIONS = { } -def get_distribution(name: str) -> Optional[Dict[str, any]]: +def get_distribution(name: str) -> Optional[Dict[str, Any]]: """Distribution definition (description + toolsets), or None if unknown.""" return DISTRIBUTIONS.get(name)