Title: Dict unpacking propagates wrong type · Issue #412 · microsoft/python-language-server · GitHub
Open Graph Title: Dict unpacking propagates wrong type · Issue #412 · microsoft/python-language-server
X Title: Dict unpacking propagates wrong type · Issue #412 · microsoft/python-language-server
Description: a, b = {1: "x", 2.0: 1j} The way iterable unpacking works, a and b should have types based on the keys of the dict, since that's what you get when you convert to the functionally equivalent: d = {1: "x", 2.0: 1j} it = iter(d) a = it.next...
Open Graph Description: a, b = {1: "x", 2.0: 1j} The way iterable unpacking works, a and b should have types based on the keys of the dict, since that's what you get when you convert to the functionally equivalent: d = {1...
X Description: a, b = {1: "x", 2.0: 1j} The way iterable unpacking works, a and b should have types based on the keys of the dict, since that's what you get when you convert to the functionally equi...
Opengraph URL: https://github.com/microsoft/python-language-server/issues/412
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Dict unpacking propagates wrong type","articleBody":"```python\r\na, b = {1: \"x\", 2.0: 1j}\r\n```\r\n\r\nThe way iterable unpacking works, `a` and `b` should have types based on the keys of the `dict`, since that's what you get when you convert to the functionally equivalent:\r\n\r\n```python\r\nd = {1: \"x\", 2.0: 1j}\r\nit = iter(d)\r\na = it.next()\r\nb = it.next()\r\n```\r\n\r\nBut, we get:\r\n\r\n\r\n\r\n\r\n\r\n`a` is being given the value type, and `b` probably the first value's type.\r\n\r\nLikely related is what happens when changing this to:\r\n\r\n```python\r\na, *b = {1: \"x\", 2.0: 1j}\r\n```\r\n\r\n`b` has no type, but should be a list.\r\n\r\nFound in #334.","author":{"url":"https://github.com/jakebailey","@type":"Person","name":"jakebailey"},"datePublished":"2018-11-19T19:07:20.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/412/python-language-server/issues/412"}
| 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:636a3262-b500-93d2-90ea-4ed3d643e03f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C808:4950B:6176023:88CBE77:6A5022E9 |
| html-safe-nonce | 78475f686d6e243eb1bad40d847576840cfff2817df9d043c3e74ef609e0459a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDODA4OjQ5NTBCOjYxNzYwMjM6ODhDQkU3Nzo2QTUwMjJFOSIsInZpc2l0b3JfaWQiOiIyOTA1ODU0NzE4MjUyMTYzODE3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 679a2e8eb8f1265a0295d05df0f8897a5f6dbafc2063466badfd357d9d33124c |
| hovercard-subject-tag | issue:382352933 |
| 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/microsoft/python-language-server/412/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9711631f1a65921b5b9cb283fb3a75de56a562b81f201a6fab941e701d1d580c/microsoft/python-language-server/issues/412 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9711631f1a65921b5b9cb283fb3a75de56a562b81f201a6fab941e701d1d580c/microsoft/python-language-server/issues/412 |
| og:image:alt | a, b = {1: "x", 2.0: 1j} The way iterable unpacking works, a and b should have types based on the keys of the dict, since that's what you get when you convert to the functionally equivalent: d = {1... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jakebailey |
| hostname | github.com |
| expected-hostname | github.com |
| None | a08040246389072795e3b4e7b33c6d9a0c564eee02e829a809326d67c418b069 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/python-language-server git https://github.com/microsoft/python-language-server.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 145901977 |
| octolytics-dimension-repository_nwo | microsoft/python-language-server |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 145901977 |
| octolytics-dimension-repository_network_root_nwo | microsoft/python-language-server |
| 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 | d1b91b18e7330fc458dfd824c61eaed7daa830d6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width