Title: Unreachable with always true/false operands to and/or · Issue #8711 · python/mypy · GitHub
Open Graph Title: Unreachable with always true/false operands to and/or · Issue #8711 · python/mypy
X Title: Unreachable with always true/false operands to and/or · Issue #8711 · python/mypy
Description: It appears that an always true/false operand into and/or is marked as unreachable, even when it doesnt cause the other operand to be short circuited away (that scenario is correct, and emits a different "is never evaluated" message). The...
Open Graph Description: It appears that an always true/false operand into and/or is marked as unreachable, even when it doesnt cause the other operand to be short circuited away (that scenario is correct, and emits a diff...
X Description: It appears that an always true/false operand into and/or is marked as unreachable, even when it doesnt cause the other operand to be short circuited away (that scenario is correct, and emits a diff...
Opengraph URL: https://github.com/python/mypy/issues/8711
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unreachable with always true/false operands to and/or ","articleBody":"It appears that an always true/false operand into and/or is marked as unreachable, even when it doesnt cause the other operand to be short circuited away (that scenario is correct, and emits a different \"is never evaluated\" message). The examples below are obviously very contrived; a more real-world example is something like\r\n\r\n```python\r\nassert isinstance(x, float) and x > 0.0\r\n```\r\n---\r\n\r\n* Are you reporting a bug, or opening a feature request? bug\r\n* Please insert below the code you are checking with mypy.\r\n ```python\r\n True and True\r\n ```\r\n* What is the actual behavior/output?\r\n ```\r\n main.py: note: In function \"foo\":\r\n main.py:1:1: error: Left operand of 'and' is always true [unreachable]\r\n True and True\r\n ^\r\n ```\r\n* What is the behavior/output you expect? Success\r\n* What are the versions of mypy and Python you are using? master (0.770+dev.833fc2caec6773683d691a72058293ae87139210) with CPython 3.7.7\r\n* What are the mypy flags you are using? Custom, but effectively `--strict`\r\n","author":{"url":"https://github.com/llchan","@type":"Person","name":"llchan"},"datePublished":"2020-04-23T00:42:19Z","url":"https://github.com/python/mypy/issues/8711"}
| 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:c8ffbda8-51eb-3823-0fe5-1fdf72b0cf3d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D20C:11BB24:2B07C98:3AAB2CD:6B005084 |
| html-safe-nonce | c51bfac9d57024c7f906dbffb944821c721ae566d2104da4b2aed729deaa3a88 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjBDOjExQkIyNDoyQjA3Qzk4OjNBQUIyQ0Q6NkIwMDUwODQiLCJ2aXNpdG9yX2lkIjoiNzI2ODQ0MzIxMjAyNzU0Nzc4MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 09a0c9b2e4180b79c64c4b8cc358faea285ca38909155a3b30340264d62f381b |
| hovercard-subject-tag | issue:605160244 |
| 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/8711/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6b1f867a8497c242604619805fa7dcb76b44d67536022f9360c2f0b514fecf0a/python/mypy/issues/8711 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6b1f867a8497c242604619805fa7dcb76b44d67536022f9360c2f0b514fecf0a/python/mypy/issues/8711 |
| og:image:alt | It appears that an always true/false operand into and/or is marked as unreachable, even when it doesnt cause the other operand to be short circuited away (that scenario is correct, and emits a diff... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | llchan |
| hostname | github.com |
| expected-hostname | github.com |
| None | f420f4996e6b1ff1ccd6d7683f8134f4b5f0f8a50124c210dbfe7490e5644abb |
| 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 | 26e00df917aba0f128135dc073ea0c5e33a70d40 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width