Title: Odd error message when kwargs passed as **dict · Issue #5382 · python/mypy · GitHub
Open Graph Title: Odd error message when kwargs passed as **dict · Issue #5382 · python/mypy
X Title: Odd error message when kwargs passed as **dict · Issue #5382 · python/mypy
Description: Checking this with mypy 0.620: from concurrent.futures import ThreadPoolExecutor import sys opts = {'max_workers': None} if sys.version_info >= (3, 6): opts['thread_name_prefix'] = 'SyncWorker' executor = ThreadPoolExecutor(**opts) ...yi...
Open Graph Description: Checking this with mypy 0.620: from concurrent.futures import ThreadPoolExecutor import sys opts = {'max_workers': None} if sys.version_info >= (3, 6): opts['thread_name_prefix'] = 'SyncWorker' exe...
X Description: Checking this with mypy 0.620: from concurrent.futures import ThreadPoolExecutor import sys opts = {'max_workers': None} if sys.version_info >= (3, 6): opts['thread_name_prefix']...
Opengraph URL: https://github.com/python/mypy/issues/5382
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Odd error message when kwargs passed as **dict","articleBody":"Checking this with mypy 0.620:\r\n```python\r\nfrom concurrent.futures import ThreadPoolExecutor\r\nimport sys\r\n\r\nopts = {'max_workers': None}\r\nif sys.version_info >= (3, 6):\r\n opts['thread_name_prefix'] = 'SyncWorker'\r\nexecutor = ThreadPoolExecutor(**opts)\r\n```\r\n...yields:\r\n```\r\nmypy_bug.py:6: error: Incompatible types in assignment (expression has type \"str\", target has type \"None\")\r\nmypy_bug.py:7: error: Argument 1 to \"ThreadPoolExecutor\" has incompatible type \"**Dict[str, None]\"; expected \"str\"\r\n```\r\nLet's ignore the first error for now. But the second seems to have an incorrect message, specifically I think the **Dict[str, None] in it is weird. Just guessing, is it trying to assign something to the ThreadPoolExecutor's thread_name_prefix arg which is a str? Maybe the None from max_workers because passing kwargs as a dict like this might result in random/varying order of the dict items? But if that's the case, I'd expect it to say something else than **Dict[str, None] as the culprit, maybe None or int, but not the whole **dict.\r\n\r\nAnother thought is that when kwargs is passed as **dicts like this, their order is not really defined, so \"Argument 1\" isn't very helpful. Would be better to say the argument's name.\r\n\r\nBut maybe I'm just all off track here -- will leave the rest to someone who actually has an informed opinion :)","author":{"url":"https://github.com/scop","@type":"Person","name":"scop"},"datePublished":"2018-07-22T09:50:01Z","url":"https://github.com/python/mypy/issues/5382"}
| 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:2a967c48-6b39-4165-53f3-ceca91b6cc34 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E8F2:1A6297:1058D7E:1582599:6B000967 |
| html-safe-nonce | ed1512b5c13a2fc5fbc050c9b995dbc2ac9de5c8b55109a2fac9d78d072bb977 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOEYyOjFBNjI5NzoxMDU4RDdFOjE1ODI1OTk6NkIwMDA5NjciLCJ2aXNpdG9yX2lkIjoiNzk4ODc4MTg1OTc1ODY3MjIzMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 60b12ef0a83084beb847c43a643752f2d45413326d8aac73443f3765ddbce3ab |
| hovercard-subject-tag | issue:343392754 |
| 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/5382/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1a111c7e3efd83e0b2d3f4503932f3cd158e9004b436b460dccf577d3f6bf343/python/mypy/issues/5382 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1a111c7e3efd83e0b2d3f4503932f3cd158e9004b436b460dccf577d3f6bf343/python/mypy/issues/5382 |
| og:image:alt | Checking this with mypy 0.620: from concurrent.futures import ThreadPoolExecutor import sys opts = {'max_workers': None} if sys.version_info >= (3, 6): opts['thread_name_prefix'] = 'SyncWorker' exe... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | scop |
| 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