Title: Consider adding `--non-numeric-bool` mode · Issue #8363 · python/mypy · GitHub
Open Graph Title: Consider adding `--non-numeric-bool` mode · Issue #8363 · python/mypy
X Title: Consider adding `--non-numeric-bool` mode · Issue #8363 · python/mypy
Description: As it was discussed in #8069, sometimes we need to logically separate int and bool types. Currently mypy allows this to happen: def some(a: int): ... some(x > 1) Because bool is subtype of int. I am proposing to add a strict-bool mode, s...
Open Graph Description: As it was discussed in #8069, sometimes we need to logically separate int and bool types. Currently mypy allows this to happen: def some(a: int): ... some(x > 1) Because bool is subtype of int. I a...
X Description: As it was discussed in #8069, sometimes we need to logically separate int and bool types. Currently mypy allows this to happen: def some(a: int): ... some(x > 1) Because bool is subtype of int. ...
Opengraph URL: https://github.com/python/mypy/issues/8363
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Consider adding `--non-numeric-bool` mode","articleBody":"As it was discussed in https://github.com/python/mypy/issues/8069, sometimes we need to logically separate `int` and `bool` types.\r\n\r\nCurrently `mypy` allows this to happen:\r\n\r\n```python\r\ndef some(a: int): ...\r\n\r\nsome(x > 1)\r\n```\r\n\r\nBecause `bool` is subtype of `int`. I am proposing to add a `strict-bool` mode, so `bool` would be treated as a non-int type. And this code would generate an error.\r\n\r\nIt can be a new config option: `--strict-bool` or a new disabled by default error code in the future as @JukkaL suggested.","author":{"url":"https://github.com/sobolevn","@type":"Person","name":"sobolevn"},"datePublished":"2020-02-04T14:55:45Z","url":"https://github.com/python/mypy/issues/8363"}
| 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:f0794a2c-25c6-dd7f-7b90-c8d82acef1ce |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 803C:2DCAE8:23FCA04:3113F29:6B003410 |
| html-safe-nonce | 8db7c8cc2e621d9750085f65f2e8ebd4a456b4b9c9f2acaad2191d45726291f9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MDNDOjJEQ0FFODoyM0ZDQTA0OjMxMTNGMjk6NkIwMDM0MTAiLCJ2aXNpdG9yX2lkIjoiMjM5ODE3Mjg2Nzg2Mzc4NjUxMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6f8ba6f20b1c286c48fe5fb369e4d53696f9d6d3384ee8346e6acadf892ce0ef |
| hovercard-subject-tag | issue:559773517 |
| 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/8363/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c2c351b680228a5478bb531f0a0546d4712804af6d1a531baf0e2f42ccf2763c/python/mypy/issues/8363 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c2c351b680228a5478bb531f0a0546d4712804af6d1a531baf0e2f42ccf2763c/python/mypy/issues/8363 |
| og:image:alt | As it was discussed in #8069, sometimes we need to logically separate int and bool types. Currently mypy allows this to happen: def some(a: int): ... some(x > 1) Because bool is subtype of int. I a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sobolevn |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| 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 | f3f3a43ca095cdea3abbb394112e971f9fdb94fa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width