Reputation: 31266
mypy 0.812
allows the following useful type hint:
def foo(a: str, b: str) -> str:
return a + b
def bar(foo_fn: Callable[[str,str],str]) -> str:
return foo_fn("foo","bar")
Bottom line is: you can remember virtually everything, but a few type hints are useful, especially when it comes to custom classes and functions passed as inputs.
However, mypy
0.761 asserts that Callable
with bracketed items is a syntax error.
Having compiled with all of mypy
0.812's requirements, the bracketed items in the source code represent an important and significant amount of work.
At the same time, a new dependency has forced poetry
to install mypy only up to version 0.761.
This means that, as of now, the project cannot pass through QA unless I change build systems from poetry to setuptools or something else which is more forgiving than poetry when it comes to dependency issues.
In all fairness, poetry might be overly exhaustive in its dependency resolution, and perhaps exposes itself to bugs and oversights.
Is there a way to control or force mypy version 0.761, which has limited documentation available (I could not find it), to ignore the type annotation syntax errors without disabling the checks once version 0.812 comes back online as packages get updated over time?
Upvotes: 0
Views: 147
Reputation: 15242
There is no way to tell poetry to ignore a dependency or it's version constraint. This is an intended behavior and was discussed in the issue tracker a lot.
What could you do?
Upvotes: 2