Title: Error initializing Union of Lists with an empty list · Issue #2164 · python/mypy · GitHub
Open Graph Title: Error initializing Union of Lists with an empty list · Issue #2164 · python/mypy
X Title: Error initializing Union of Lists with an empty list · Issue #2164 · python/mypy
Description: The following test case [case testUnionListInit] from typing import Union, List a = [] # type: Union[List[int], List[str]] [builtins fixtures/list.pyi] Results in Expected: Actual: main:2: error: Incompatible types in assignment (express...
Open Graph Description: The following test case [case testUnionListInit] from typing import Union, List a = [] # type: Union[List[int], List[str]] [builtins fixtures/list.pyi] Results in Expected: Actual: main:2: error: I...
X Description: The following test case [case testUnionListInit] from typing import Union, List a = [] # type: Union[List[int], List[str]] [builtins fixtures/list.pyi] Results in Expected: Actual: main:2: error: I...
Opengraph URL: https://github.com/python/mypy/issues/2164
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Error initializing Union of Lists with an empty list","articleBody":"The following test case\n\n```\n[case testUnionListInit]\nfrom typing import Union, List\na = [] # type: Union[List[int], List[str]]\n[builtins fixtures/list.pyi]\n```\n\nResults in\n\n```\nExpected:\nActual:\n main:2: error: Incompatible types in assignment (expression has type List[None], variable has type \"Union[List[int], List[str]]\") (diff)\n```\n\nThis came up during PR #2154, but I think is an independent issue.\n","author":{"url":"https://github.com/elazarg","@type":"Person","name":"elazarg"},"datePublished":"2016-09-21T17:08:16Z","url":"https://github.com/python/mypy/issues/2164"}
| 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:8f9cfe91-e173-d813-465d-90954750702a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CC8E:2A087:A0D39B:D6FCDA:6B004786 |
| html-safe-nonce | fdfb6ed23548dc43020f0679de7c5046e98972b421d610d4eccd99c1bce0ba04 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQzhFOjJBMDg3OkEwRDM5QjpENkZDREE6NkIwMDQ3ODYiLCJ2aXNpdG9yX2lkIjoiNzc2NDc1NDE3MDg3MTAzOTg3OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | efbe2fb9d87011c4ee9e7d30e6f83b18ae34d7384b0a3ae797ec3c43dc1691ea |
| hovercard-subject-tag | issue:178407585 |
| 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/2164/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9efbea609f3b1652ca496f6d39b8682f4b0307052efd4a0220e6014200fbe805/python/mypy/issues/2164 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9efbea609f3b1652ca496f6d39b8682f4b0307052efd4a0220e6014200fbe805/python/mypy/issues/2164 |
| og:image:alt | The following test case [case testUnionListInit] from typing import Union, List a = [] # type: Union[List[int], List[str]] [builtins fixtures/list.pyi] Results in Expected: Actual: main:2: error: I... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | elazarg |
| 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