Skip to content

Commit 7904483

Browse files
authored
Change Mapping to dict in resolution Result type annotations
`typing.Mapping` is a broad concept. The actual code just assigns `dict`s so `Result` should just use that. I've been adding annotations to the calling side (`ansible-galaxy`) that uses `resolvelib` and hit this as I was trying to show that a function that returns `Resolver(...).resolve(...).mapping` produces a `dict`.
1 parent 0ede09c commit 7904483

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/resolvelib/resolvers/abstract.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
import collections
4-
from typing import TYPE_CHECKING, Any, Generic, Iterable, Mapping, NamedTuple
4+
from typing import TYPE_CHECKING, Any, Generic, Iterable, NamedTuple
55

66
from ..structs import CT, KT, RT, DirectedGraph
77

@@ -11,9 +11,9 @@
1111
from .criterion import Criterion
1212

1313
class Result(NamedTuple, Generic[RT, CT, KT]):
14-
mapping: Mapping[KT, CT]
14+
mapping: dict[KT, CT]
1515
graph: DirectedGraph[KT | None]
16-
criteria: Mapping[KT, Criterion[RT, CT]]
16+
criteria: dict[KT, Criterion[RT, CT]]
1717

1818
else:
1919
Result = collections.namedtuple("Result", ["mapping", "graph", "criteria"])

0 commit comments

Comments
 (0)