Title: mypy doesn't understand partial unpacking with star arguments · Issue #9706 · python/mypy · GitHub
Open Graph Title: mypy doesn't understand partial unpacking with star arguments · Issue #9706 · python/mypy
X Title: mypy doesn't understand partial unpacking with star arguments · Issue #9706 · python/mypy
Description: Bug Report While working on qutebrowser/qutebrowser#5317 I think I may have found a bug in mypy. The following code looks correct, and runs fine on my machine. To Reproduce Save the following code to file /tmp/reproducer.py #!/usr/bin/en...
Open Graph Description: Bug Report While working on qutebrowser/qutebrowser#5317 I think I may have found a bug in mypy. The following code looks correct, and runs fine on my machine. To Reproduce Save the following code ...
X Description: Bug Report While working on qutebrowser/qutebrowser#5317 I think I may have found a bug in mypy. The following code looks correct, and runs fine on my machine. To Reproduce Save the following code ...
Opengraph URL: https://github.com/python/mypy/issues/9706
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"mypy doesn't understand partial unpacking with star arguments","articleBody":"**Bug Report**\r\n\r\nWhile working on https://github.com/qutebrowser/qutebrowser/pull/5317 I think I may have found a bug in mypy. The following code _looks_ correct, and runs fine on my machine.\r\n\r\n**To Reproduce**\r\n\r\n1. Save the following code to file `/tmp/reproducer.py`\r\n```python\r\n#!/usr/bin/env python\r\n# -*- coding: utf-8 -*-\r\n# vim: fenc=utf-8:et:ts=4:sts=4:sw=4:fdm=marker\r\nfrom typing import Optional, Sequence, Mapping\r\nimport collections\r\n\r\nclass ModuleInfo:\r\n def __init__(\r\n self,\r\n name: str,\r\n version_attributes: Sequence[str],\r\n min_version: Optional[str] = None\r\n ):\r\n self.name = name\r\n self._version_attributes = version_attributes\r\n self.min_version = min_version\r\n\r\nMODULE_INFO: Mapping[str, ModuleInfo] = collections.OrderedDict([\r\n (name, ModuleInfo(name, *args))\r\n for (name, *args) in\r\n [\r\n ('sip', ['SIP_VERSION_STR']),\r\n ('colorama', ['VERSION', '__version__']),\r\n ('pypeg2', ['__version__']),\r\n ('jinja2', ['__version__']),\r\n ('pygments', ['__version__']),\r\n ('yaml', ['__version__']),\r\n ('adblock', ['__version__'], \"0.3.2\"),\r\n ('cssutils', ['__version__']),\r\n ('attr', ['__version__']),\r\n ('PyQt5.QtWebEngineWidgets', []),\r\n ('PyQt5.QtWebEngine', ['PYQT_WEBENGINE_VERSION_STR']),\r\n ('PyQt5.QtWebKitWidgets', []),\r\n ]\r\n])\r\n```\r\n2. Run `mypy /tmp/reproducer.py`.\r\n\r\n**Expected Behavior**\r\n\r\nThere should be no type errors.\r\n\r\n**Actual Behavior**\r\n\r\nThe output of the command in step 2 returns:\r\n```\r\nreproducer.py:19: error: List comprehension has incompatible type List[Tuple[Sequence[str], ModuleInfo]]; expected List[Tuple[str, ModuleInfo]]\r\nreproducer.py:19: error: Argument 1 to \"ModuleInfo\" has incompatible type \"Sequence[str]\"; expected \"str\"\r\nreproducer.py:19: error: Argument 2 to \"ModuleInfo\" has incompatible type \"*List[Sequence[str]]\"; expected \"Optional[str]\"\r\nFound 3 errors in 1 file (checked 1 source file)\r\n```\r\n\r\n**Your Environment**\r\n\r\n\u003c!-- Include as many relevant details about the environment you experienced the bug in -->\r\n\r\n- Mypy version used: `mypy 0.790`\r\n- Mypy command-line flags: `mypy /tmp/reproducer.py`\r\n- Mypy configuration options from `mypy.ini` (and other config files): None, I think\r\n- Python version used: `Python 3.8.6`\r\n- Operating system and version: Gentoo Linux\r\n","author":{"url":"https://github.com/ArniDagur","@type":"Person","name":"ArniDagur"},"datePublished":"2020-11-06T11:19:10Z","url":"https://github.com/python/mypy/issues/9706"}
| 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:32a5d7d5-390e-a190-e4c7-7202bf22d00c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C7A2:4D728:28DCAA2:35654D9:6B0005C5 |
| html-safe-nonce | 689b1e7e82cb8689f8987636b88bac03240e0465c09d01c495948b7d36be9490 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDN0EyOjRENzI4OjI4RENBQTI6MzU2NTREOTo2QjAwMDVDNSIsInZpc2l0b3JfaWQiOiI3MTY2NzEzMDgwNTEwOTQwNjEzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 70422bab0ae5dc3e2c5b157cc11f298be15d4a51be82c30ba2108c95392e65f3 |
| hovercard-subject-tag | issue:737681143 |
| 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/9706/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a715fe637a232ced919e0cceed31f6d61f3425568ff91ef0823c7b5b38dcc2ce/python/mypy/issues/9706 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a715fe637a232ced919e0cceed31f6d61f3425568ff91ef0823c7b5b38dcc2ce/python/mypy/issues/9706 |
| og:image:alt | Bug Report While working on qutebrowser/qutebrowser#5317 I think I may have found a bug in mypy. The following code looks correct, and runs fine on my machine. To Reproduce Save the following code ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ArniDagur |
| 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