Title: Unions of TypedDicts don't work as expected · Issue #5930 · python/mypy · GitHub
Open Graph Title: Unions of TypedDicts don't work as expected · Issue #5930 · python/mypy
X Title: Unions of TypedDicts don't work as expected · Issue #5930 · python/mypy
Description: Operations on unions of typed dicts seem to use the fallback types, resulting in unexpected types: from mypy_extensions import TypedDict from typing import Union class A(TypedDict): x: int y: str class B(TypedDict): x: str d: Union[A, B]...
Open Graph Description: Operations on unions of typed dicts seem to use the fallback types, resulting in unexpected types: from mypy_extensions import TypedDict from typing import Union class A(TypedDict): x: int y: str c...
X Description: Operations on unions of typed dicts seem to use the fallback types, resulting in unexpected types: from mypy_extensions import TypedDict from typing import Union class A(TypedDict): x: int y: str c...
Opengraph URL: https://github.com/python/mypy/issues/5930
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unions of TypedDicts don't work as expected","articleBody":"Operations on unions of typed dicts seem to use the fallback types, resulting in unexpected types:\r\n\r\n```py\r\nfrom mypy_extensions import TypedDict\r\nfrom typing import Union\r\n\r\nclass A(TypedDict):\r\n x: int\r\n y: str\r\n\r\nclass B(TypedDict):\r\n x: str\r\n\r\nd: Union[A, B]\r\nreveal_type(d['x']) # builtins.object (expected: Union[int, str])\r\nreveal_type(d.get('x')) # builtins.object (expected: Union[int, str, None])\r\n```","author":{"url":"https://github.com/JukkaL","@type":"Person","name":"JukkaL"},"datePublished":"2018-11-21T10:26:20Z","url":"https://github.com/python/mypy/issues/5930"}
| 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:0e20fc40-8672-f6d3-d765-e2f4a4031f23 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A484:18FDF5:52EDC8:6EBB7A:6B002F50 |
| html-safe-nonce | 76fcc5b45a1d7048434e339e67cf19c9f10a16aab92ca3608542a6a3980b73d9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNDg0OjE4RkRGNTo1MkVEQzg6NkVCQjdBOjZCMDAyRjUwIiwidmlzaXRvcl9pZCI6IjE3MjkwMzM2NTMzODk4OTc1NTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 2c5cf5c6496e0b0f02cf4817175581828de2e2db6c11dbedc584f8c59a7005b5 |
| hovercard-subject-tag | issue:383050853 |
| 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/5930/issue_layout |
| twitter:image | https://opengraph.githubassets.com/538a3e5b9954833cf0aa99b6487245c0606835e872e04962cff86d78472a533b/python/mypy/issues/5930 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/538a3e5b9954833cf0aa99b6487245c0606835e872e04962cff86d78472a533b/python/mypy/issues/5930 |
| og:image:alt | Operations on unions of typed dicts seem to use the fallback types, resulting in unexpected types: from mypy_extensions import TypedDict from typing import Union class A(TypedDict): x: int y: str c... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JukkaL |
| 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