Title: Unions that include Any should probably not just become Any · Issue #1642 · python/mypy · GitHub
Open Graph Title: Unions that include Any should probably not just become Any · Issue #1642 · python/mypy
X Title: Unions that include Any should probably not just become Any · Issue #1642 · python/mypy
Description: Currently, UnionType.make_simplified_union will return an Any if any of the types passed in are Any. This probably doesn't make sense. As a simple example, if we have: def f(x: Union[str, Any]) -> int: return x + 1 (This example looks a ...
Open Graph Description: Currently, UnionType.make_simplified_union will return an Any if any of the types passed in are Any. This probably doesn't make sense. As a simple example, if we have: def f(x: Union[str, Any]) -> ...
X Description: Currently, UnionType.make_simplified_union will return an Any if any of the types passed in are Any. This probably doesn't make sense. As a simple example, if we have: def f(x: Union[str, Any])...
Opengraph URL: https://github.com/python/mypy/issues/1642
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unions that include Any should probably not just become Any","articleBody":"Currently, `UnionType.make_simplified_union` will return an Any if any of the types passed in are Any. This probably doesn't make sense.\n\nAs a simple example, if we have:\n\n``` py\ndef f(x: Union[str, Any]) -> int:\n return x + 1\n```\n\n(This example looks a little silly, but this `Any` might not be explicit -- it could e.g. be a class from a --silent-imports module.)\nThis is clearly unsafe. I think we should still require an isinstance check.\n","author":{"url":"https://github.com/ddfisher","@type":"Person","name":"ddfisher"},"datePublished":"2016-06-03T23:17:52Z","url":"https://github.com/python/mypy/issues/1642"}
| 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:1f99374e-2c80-ac9c-4969-28e0af5242c5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E494:244A6A:11A7734:1731D54:6B000CFE |
| html-safe-nonce | ceb9a3587899b04e6fd7b7a0add50a85454176a7a9ee24b8c18258904a516788 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNDk0OjI0NEE2QToxMUE3NzM0OjE3MzFENTQ6NkIwMDBDRkUiLCJ2aXNpdG9yX2lkIjoiMjU3MDI2MjIwMDE0MDY5NjgzMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e31fe5f3b34c881795c9fa46c5afca9ef4073f4f3bc32d6c43e771be0d2ae916 |
| hovercard-subject-tag | issue:158471828 |
| 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/1642/issue_layout |
| twitter:image | https://opengraph.githubassets.com/402056a2c69793bcdc8acbeb78fc4d7cacca64b3f40aba05f552d80c0b5d6d28/python/mypy/issues/1642 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/402056a2c69793bcdc8acbeb78fc4d7cacca64b3f40aba05f552d80c0b5d6d28/python/mypy/issues/1642 |
| og:image:alt | Currently, UnionType.make_simplified_union will return an Any if any of the types passed in are Any. This probably doesn't make sense. As a simple example, if we have: def f(x: Union[str, Any]) -> ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ddfisher |
| hostname | github.com |
| expected-hostname | github.com |
| None | cf7ee0062053ad9eb05b6e5de57bd96c2055708bcbada4144946b5ec129cf1d7 |
| 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 | 9cab7de176a56362d2aabcbb4d1e07e846eba8a0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width