-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade mypy to 0.720, turn on unreachability warnings #25157
Conversation
@@ -53,7 +53,7 @@ def repr_helper(inp: Any) -> str: | |||
return str(inp) | |||
|
|||
|
|||
def convert(value: T, to_type: Callable[[T], U], | |||
def convert(value: Optional[T], to_type: Callable[[T], U], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is that Optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it is really optional -- the code has specific checks and treatment of None
values.
There are so many |
Despite those (not that many IMO), unreachability checks helped catch some real issues. I think it's a net positive and should be enabled already now. |
Also, the mypy 7207 was directed to python/mypy#3186 which seems to be kind of a long standing one, and might take a while to fix, and the fix might not be even actually in mypy but elsewhere. So I wouldn't wait for that from that POV either. |
Looks good 👍 |
…into hive_water_heater * 'dev' of https://github.com/home-assistant/home-assistant: (49 commits) Pin Docker to Debain Stretch (home-assistant#25206) Updated frontend to 20190717.0 Add HmIP-PCBS2, HmIP-PCBS-BAT to Homematic IP Cloud (home-assistant#25201) Simplify cache restore (home-assistant#25186) Only include target temp if has right support flag (home-assistant#25193) Fix issue home-assistant#24495 (home-assistant#25199) Handle somfy expired token (home-assistant#25195) Add login_method config option to fix login issue with RouterOS Version > 6.43 (home-assistant#25194) Add HMIP-FCI / HMIP-FBL / HmIP-BBL (home-assistant#25188) [climate] Tweak evohome migration (home-assistant#25187) Fix device name customization on ZHA add devices page (home-assistant#25180) Upgrade mypy to 0.720, turn on unreachability warnings (home-assistant#25157) Use MockConfigEntry (home-assistant#25190) Add severe weather sensor to Dark Sky (home-assistant#22701) Fix typo in azure-pipelines-ci.yml Raise not ready when no data from API is retrieved (home-assistant#25182) Improve Nuki lock (home-assistant#22888) Delete config.yml (home-assistant#25181) Upgrade luftdaten to 0.6.2 (home-assistant#25177) Upgrade Mastodon.py to 1.4.5 (home-assistant#25176) ... # Conflicts: # homeassistant/components/hive/water_heater.py
Description:
http://mypy-lang.blogspot.com/2019/07/mypy-0720-released.html
Checklist:
tox
. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
python3 -m script.hassfest
.requirements_all.txt
by runningpython3 -m script.gen_requirements_all
..coveragerc
.If the code does not interact with devices: