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.
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user