Title: Certain order of union members causes Incompatible types error · Issue #3085 · python/mypy · GitHub
Open Graph Title: Certain order of union members causes Incompatible types error · Issue #3085 · python/mypy
X Title: Certain order of union members causes Incompatible types error · Issue #3085 · python/mypy
Description: I’m getting this weird error: Incompatible types in assignment (expression has type Dict[str, Union[str, float]], variable has type Dict[str, Union[str, int, float, bool]]) Value = Union[str, int, float, bool] d: Dict[str, Value] d = {} ...
Open Graph Description: I’m getting this weird error: Incompatible types in assignment (expression has type Dict[str, Union[str, float]], variable has type Dict[str, Union[str, int, float, bool]]) Value = Union[str, int, ...
X Description: I’m getting this weird error: Incompatible types in assignment (expression has type Dict[str, Union[str, float]], variable has type Dict[str, Union[str, int, float, bool]]) Value = Union[str, int, ...
Opengraph URL: https://github.com/python/mypy/issues/3085
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Certain order of union members causes Incompatible types error","articleBody":"I’m getting this weird error: Incompatible types in assignment (expression has type Dict[str, Union[str, float]], variable has type Dict[str, Union[str, int, float, bool]])\r\n\r\n```python\r\nValue = Union[str, int, float, bool]\r\nd: Dict[str, Value]\r\nd = {}\r\n```\r\n\r\nhowever this works:\r\n```python\r\nValue = Union[str, float, bool, int]\r\n```\r\n\r\nThe order of union elements is different.\r\n\r\nOther offenses:\r\n\r\n`Value = Union[int, str, bool, float]`\r\n`Value = Union[str, int, bool, float]`\r\n\r\nCauses: `Incompatible types in assignment (expression has type Dict[str, Union[str, float]], variable has type Dict[str, Union[int, str, bool, float]])`\r\n\r\n\r\n\r\n","author":{"url":"https://github.com/Stiivi","@type":"Person","name":"Stiivi"},"datePublished":"2017-03-30T02:44:41Z","url":"https://github.com/python/mypy/issues/3085"}
| 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:4a7b539c-55b0-bec0-4a75-da65528eed4e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9312:DD1C:1BB5385:2565852:6B0005F7 |
| html-safe-nonce | e6d09362876e729c848942ee70f389a9b2c3652380bd14cc74e9daf6bb2a086a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MzEyOkREMUM6MUJCNTM4NToyNTY1ODUyOjZCMDAwNUY3IiwidmlzaXRvcl9pZCI6IjYxMzIwNjA5MDQ5MjMwNzE5OTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 2e2aae49ff1c2f5bd75aa700486d1889280cc3e92fbc7a499b05561298818658 |
| hovercard-subject-tag | issue:218065257 |
| 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/3085/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fb46cf034a66e0d6f210e5e92036bd02c1b8904aa4c168d53eae076c14897304/python/mypy/issues/3085 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fb46cf034a66e0d6f210e5e92036bd02c1b8904aa4c168d53eae076c14897304/python/mypy/issues/3085 |
| og:image:alt | I’m getting this weird error: Incompatible types in assignment (expression has type Dict[str, Union[str, float]], variable has type Dict[str, Union[str, int, float, bool]]) Value = Union[str, int, ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Stiivi |
| 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