Title: Another --warn-unreachable false positive · Issue #7207 · python/mypy · GitHub
Open Graph Title: Another --warn-unreachable false positive · Issue #7207 · python/mypy
X Title: Another --warn-unreachable false positive · Issue #7207 · python/mypy
Description: I'm not sure if this is the same issue as #7204, but here's another --warn-unreahcable false positive with a much smaller test case: from numbers import Number def test(x: float) -> None: if not isinstance(x, Number): raise print("Not un...
Open Graph Description: I'm not sure if this is the same issue as #7204, but here's another --warn-unreahcable false positive with a much smaller test case: from numbers import Number def test(x: float) -> None: if not is...
X Description: I'm not sure if this is the same issue as #7204, but here's another --warn-unreahcable false positive with a much smaller test case: from numbers import Number def test(x: float) -> None...
Opengraph URL: https://github.com/python/mypy/issues/7207
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Another --warn-unreachable false positive","articleBody":"I'm not sure if this is the same issue as #7204, but here's another --warn-unreahcable false positive with a much smaller test case:\r\n\r\n```python\r\nfrom numbers import Number\r\n\r\ndef test(x: float) -> None:\r\n if not isinstance(x, Number):\r\n raise\r\n print(\"Not unreachable!\")\r\n```\r\n...gives with mypy 0.720:\r\n```\r\nt.py:6: error: Statement is unreachable\r\n```\r\nAssuming mypy relies on `x` always being a float like the type hint says, the \"not isinstance\" is actually always False and I guess it would be legitimate for the error to be issued on line 5 (`raise`). But surely the `print` statement on line 6 is never unreachable, right?","author":{"url":"https://github.com/scop","@type":"Person","name":"scop"},"datePublished":"2019-07-14T08:34:40Z","url":"https://github.com/python/mypy/issues/7207"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3a20c793-9d38-e573-0083-8d044a591d7d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CEB4:15C5B6:207FD:2B81F:6B004DCD |
| html-safe-nonce | 37b53b805136baceb1ae01f3904a5a5cd3e01ff65c98154e9c342834f2f468e4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRUI0OjE1QzVCNjoyMDdGRDoyQjgxRjo2QjAwNERDRCIsInZpc2l0b3JfaWQiOiI2ODA3OTI4MzY5MzI2NTI0OTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0d1cef93d9356daff462dd949a25cc05bd1d0cbb82fabba241ea3b30f44d9c04 |
| hovercard-subject-tag | issue:467810583 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/mypy/7207/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c5bb2503df16259b3b6a6a87745ca55ebcd5dd12464af71ec396ae0b552c0e90/python/mypy/issues/7207 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c5bb2503df16259b3b6a6a87745ca55ebcd5dd12464af71ec396ae0b552c0e90/python/mypy/issues/7207 |
| og:image:alt | I'm not sure if this is the same issue as #7204, but here's another --warn-unreahcable false positive with a much smaller test case: from numbers import Number def test(x: float) -> None: if not is... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | scop |
| hostname | github.com |
| expected-hostname | github.com |
| None | f9517bf360d46638a1e5e7daee7158842fe5ef43c9000afa0e127564a7c2f39b |
| turbo-cache-control | no-preview |
| go-import | github.com/python/mypy git https://github.com/python/mypy.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 7053637 |
| octolytics-dimension-repository_nwo | python/mypy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7053637 |
| octolytics-dimension-repository_network_root_nwo | python/mypy |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b27c5dde30676028abd5c5fc53ce5c9b625f8281 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width