Change Mapping to dict in resolution Result type annotations#193
Change Mapping to dict in resolution Result type annotations#193notatallshaw merged 1 commit intosarugaku:mainfrom
Mapping to dict in resolution Result type annotations#193Conversation
`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`.
|
Is it not expected that anyone is sub-classing Could this be done at the `Resolver(...).resolve(...) level instead? Or does that break some type theory invariant? I'm not against this, just thinking about where things could go wrong. |
|
@notatallshaw AFAIK, only the This cannot be done on the |
|
Great, let's do this. |
typing.Mappingis a broad concept. The actual code just assignsdicts soResultshould just use that.I've been adding annotations to the calling side (
ansible-galaxy) that usesresolveliband hit this as I was trying to show that a function that returnsResolver(...).resolve(...).mappingproduces adict.