Title: Fold Void into NoneTyp, in the strict-None world · Issue #1975 · python/mypy · GitHub
Open Graph Title: Fold Void into NoneTyp, in the strict-None world · Issue #1975 · python/mypy
X Title: Fold Void into NoneTyp, in the strict-None world · Issue #1975 · python/mypy
Description: We have within mypy a concept "Void" that functions much like Python's None but refers specifically to a None returned from a function. Because in Python a function that just returns None is tantamount to a function with no return value,...
Open Graph Description: We have within mypy a concept "Void" that functions much like Python's None but refers specifically to a None returned from a function. Because in Python a function that just returns None is tantam...
X Description: We have within mypy a concept "Void" that functions much like Python's None but refers specifically to a None returned from a function. Because in Python a function that just returns ...
Opengraph URL: https://github.com/python/mypy/issues/1975
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Fold Void into NoneTyp, in the strict-None world","articleBody":"We have within mypy a concept \"`Void`\" that functions much like Python's `None` but refers specifically to a `None` returned from a function. Because in Python a function that just returns None is tantamount to a function with no return value, this concept tracks that \"no return value\" and we use it to detect situations like assigning such a \"nonexistent\" return value to a variable so we can report errors on them.\n\nWith the advent of strict None-checking (`--strict-optional`), the actual type `None` (as PEP 484 spells it) becomes much more common, and this distinction starts causing situations that are hard to reason about. E.g., #1956 and (probably) #1957 stem from this.\n\nAfter some discussion with @ddfisher and @gvanrossum, the right solution is probably to eliminate `Void` as a separate internal type (when under `--strict-optional`) and replace it with `NoneTyp`. To implement the checks around the idea of \"no return value\", we can add a flag to `NoneTyp` which is inert to most operations but is set on function return types and is checked in specific places to implement those checks.\n\nIt's possible this will change the exact set of situations that we detect related to using \"nonexistent\" return values or returning something in a function that \"doesn't return a value\". We'd like these checks to be good, but it's OK for the specifics to change because these checks are inherently best-effort to begin with -- there isn't a clear semantics that these checks implement in the first place.\n","author":{"url":"https://github.com/gnprice","@type":"Person","name":"gnprice"},"datePublished":"2016-08-01T23:09:26Z","url":"https://github.com/python/mypy/issues/1975"}
| 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:adae40d8-17a9-e0fc-806d-22c14f3e02ef |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9A12:15D703:D25DD8:11132FB:6AFFF74D |
| html-safe-nonce | 3eaa8699103d2f905376be284921eeebce2c16da7d3d9ecbd5956dc2acf9f60c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QTEyOjE1RDcwMzpEMjVERDg6MTExMzJGQjo2QUZGRjc0RCIsInZpc2l0b3JfaWQiOiI4Nzc1NTM5OTQzMzM5NDU2MzMzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 2ba52a2e4b467e4615a4d07fcf083b616e817cb495d6081b9b3640fec78ed9ef |
| hovercard-subject-tag | issue:168763002 |
| 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/1975/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b114aad9b4c9da334918864f7e6d3bcc8ad66cb4ac5565278aaf5442ba573a83/python/mypy/issues/1975 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b114aad9b4c9da334918864f7e6d3bcc8ad66cb4ac5565278aaf5442ba573a83/python/mypy/issues/1975 |
| og:image:alt | We have within mypy a concept "Void" that functions much like Python's None but refers specifically to a None returned from a function. Because in Python a function that just returns None is tantam... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | gnprice |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729 |
| 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 | 16a11879678aaf97e2a42c33ee70830aa084fa37 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width