-
Notifications
You must be signed in to change notification settings - Fork 83
Closed
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Milestone
Description
Hi
Context
I use very often static type checkers of python, like pyright.
Recently I installed this library and got the reportUnknownVariableType error.
Here is an image of notification
Is mainly due to the context parameter which is defined as dict only. So, this provokes the Unknown error.
Proposal
Since the context should receive a type and an instance, I suggest to create a subtype like this:
from typing import TypeVar
T = TypeVar("T")
def func(context: dict[type[T], T]) -> None:
pass
func({int: 1}) # <- 0 error
func({str: 1}) # <- error
what do you think?
Enviroment configuration
I was using dishka-1.2.0
This was my project.toml pyright config:
[tool.pyright]
include = ["code"]
exclude = ["projects"]
pythonVersion = "3.10"
pythonPlatform = "Linux"
strict = ["**"]
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers