Title: Tuple[int, int] not unpacked correctly into lvar tuple · Issue #1457 · microsoft/python-language-server · GitHub
Open Graph Title: Tuple[int, int] not unpacked correctly into lvar tuple · Issue #1457 · microsoft/python-language-server
X Title: Tuple[int, int] not unpacked correctly into lvar tuple · Issue #1457 · microsoft/python-language-server
Description: Description In the following piece of code, the Microsoft Python Analysis Engine incorrectly infers the types of a and b when hovering over them. Minimal reproducible example from typing import Tuple, List def foo() -> List[Tuple[int, in...
Open Graph Description: Description In the following piece of code, the Microsoft Python Analysis Engine incorrectly infers the types of a and b when hovering over them. Minimal reproducible example from typing import Tup...
X Description: Description In the following piece of code, the Microsoft Python Analysis Engine incorrectly infers the types of a and b when hovering over them. Minimal reproducible example from typing import Tup...
Opengraph URL: https://github.com/microsoft/python-language-server/issues/1457
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Tuple[int, int] not unpacked correctly into lvar tuple","articleBody":"# Description\r\n\r\nIn the following piece of code, the Microsoft Python Analysis Engine incorrectly infers the types of `a` and `b` when hovering over them.\r\n\r\n# Minimal reproducible example\r\n\r\n```python\r\nfrom typing import Tuple, List\r\n\r\ndef foo() -> List[Tuple[int, int]]:\r\n return [(1, -1)]\r\n\r\nresult = foo()\r\n(a, b) = result[0]\r\n```\r\n\r\n# Expected behavior\r\n\r\nWhen hovering over `a` or `b`, I expect to see `a: int` and `b: int`.\r\n\r\n# Actual behavior\r\n\r\nWhen hovering over `a` or `b`, it shows `a: Tuple[int, int]` and `b: Tuple[int, int]`. I also tested this using PyCharm CE and it correctly inferred the types (i.e. `a: int` and `b: int`).\r\n\r\n# System information\r\n\r\n**OS**: macOS \"Mojave\" 10.14.6 (18G87)\r\n\r\n## Visual Studio Code\r\n\r\n**Python extension version**: 2019.8.30787\r\n\r\n**Version**: 1.37.1\r\n**Commit**: f06011ac164ae4dc8e753a3fe7f9549844d15e35\r\n**Date**: 2019-08-15T16:16:34.800Z\r\n**Electron**: 4.2.7\r\n**Chrome**: 69.0.3497.128\r\n**Node.js**: 10.11.0\r\n**V8**: 6.9.427.31-electron.0\r\n**OS**: Darwin x64 18.7.0\r\n","author":{"url":"https://github.com/bvanrijn","@type":"Person","name":"bvanrijn"},"datePublished":"2019-08-19T18:29:22Z","url":"https://github.com/microsoft/python-language-server/issues/1457"}
| 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:1381ed7e-e99c-f624-e0b0-2e769ceceb66 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CA4C:BAA88:476D0:6171E:6AFE83CD |
| html-safe-nonce | bd4e784ed40fd0fe88a8f2ecc0e8033c8b8892fbcf3d93148b67f5097f83266d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQTRDOkJBQTg4OjQ3NkQwOjYxNzFFOjZBRkU4M0NEIiwidmlzaXRvcl9pZCI6Ijg2ODAxMTQ2OTA2NjkzMTUwMjEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | bf60255c0eacdb6b0b24a2fc456d35e295e9242e267cf1b11002056a29aab7ad |
| hovercard-subject-tag | issue:482461689 |
| 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/1457/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cd92ac5914f3b7528e764f981c3101dfaa05f6931c0a27f5a2c88a9558aa3ccf/microsoft/python-language-server/issues/1457 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cd92ac5914f3b7528e764f981c3101dfaa05f6931c0a27f5a2c88a9558aa3ccf/microsoft/python-language-server/issues/1457 |
| og:image:alt | Description In the following piece of code, the Microsoft Python Analysis Engine incorrectly infers the types of a and b when hovering over them. Minimal reproducible example from typing import Tup... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bvanrijn |
| hostname | github.com |
| expected-hostname | github.com |
| None | b3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86 |
| 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 | 4a10310af51a1bfffbedc4fd81cb582acf0cb0ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width