Upgrade mypy to 0.770, tighten config a bit (#32715)

* Upgrade mypy to 0.770, related cleanups

https://mypy-lang.blogspot.com/2020/03/mypy-0770-released.html

* Clean up config and make it a notch stricter, address findings
This commit is contained in:
Ville Skyttä
2020-03-12 12:52:20 +02:00
committed by GitHub
parent 77ebda0c20
commit 221d5205e4
14 changed files with 29 additions and 37 deletions

View File

@ -109,10 +109,7 @@ class UnitSystem:
if not isinstance(temperature, Number):
raise TypeError(f"{temperature!s} is not a numeric value.")
# type ignore: https://github.com/python/mypy/issues/7207
return temperature_util.convert( # type: ignore
temperature, from_unit, self.temperature_unit
)
return temperature_util.convert(temperature, from_unit, self.temperature_unit)
def length(self, length: Optional[float], from_unit: str) -> float:
"""Convert the given length to this unit system."""