Closed pauleveritt closed 2 years ago
Unfortunately, there's no way to handle this. At least none that I'm aware of. The only possible modification of the ParamSpec
(PEP-612) is concatenation. I can't specify that arguments have now default values. And even if it could be possible, I would also need to be able to identify at compile/import time which arguments you're injecting...
That's why I've added the notation with the default argument (inject.me
, inject.get
currently). It's the only one working nicely with mypy.
Good enough, we'll close this. Sorry for two posts, wasn't sure if they should be exactly the same topic.
In the Injection Tutorial we have different flavors of injection. Here's a rewritten version:
mypy
says: