What I Want
The projects I work on include MyPy in the testing pipeline. For "quality of life" and code readability reasons I am on a mission to reduce the need for `# type: ignore" style comments as much as possible
Proposed Solution
In my current project I am using the following wrapper:
Params=ParamSpec('Params')
ReturnVar=TypeVar('ReturnVar')
Func=Callable[Params, ReturnVar]
deftyped_callback(app: Dash, *args: Any, **kwargs: Any) ->Callable[[Func], Func]:
returncast(Callable[[Func], Func], app.callback(*args, **kwargs))I have forked the dev branch and added a typed_callback function (here: _callback.py) as a proof of concept.
I would like feedback on this idea.
(Disclosure: the tests in my fork were generated using AI)
What I Want
The projects I work on include MyPy in the testing pipeline. For "quality of life" and code readability reasons I am on a mission to reduce the need for `# type: ignore" style comments as much as possible
Proposed Solution
In my current project I am using the following wrapper:
I have forked the dev branch and added a
typed_callbackfunction (here: _callback.py) as a proof of concept.I would like feedback on this idea.
(Disclosure: the tests in my fork were generated using AI)