Title: Regression on master: dict.get(default=None) gives 'no overload matches argument types' · Issue #11646 · python/mypy · GitHub
Open Graph Title: Regression on master: dict.get(default=None) gives 'no overload matches argument types' · Issue #11646 · python/mypy
X Title: Regression on master: dict.get(default=None) gives 'no overload matches argument types' · Issue #11646 · python/mypy
Description: Bug Report After the latest sync from typeshed (commit 4996d57, PR #11600), this valid code is highlighted as error by mypy: def foo(vars: dict[str, str]): val = vars.get("fqdn", default=None) reveal_type(val) Result before: _local/dictg...
Open Graph Description: Bug Report After the latest sync from typeshed (commit 4996d57, PR #11600), this valid code is highlighted as error by mypy: def foo(vars: dict[str, str]): val = vars.get("fqdn", default=None) reve...
X Description: Bug Report After the latest sync from typeshed (commit 4996d57, PR #11600), this valid code is highlighted as error by mypy: def foo(vars: dict[str, str]): val = vars.get("fqdn", default=...
Opengraph URL: https://github.com/python/mypy/issues/11646
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Regression on master: dict.get(default=None) gives 'no overload matches argument types'","articleBody":"**Bug Report**\r\n\r\nAfter the latest sync from typeshed (commit 4996d571272adde83a3de2689c0147ca1be23f2c, PR #11600), this valid code is highlighted as error by mypy:\r\n\r\n```python\r\ndef foo(vars: dict[str, str]):\r\n val = vars.get(\"fqdn\", default=None)\r\n reveal_type(val)\r\n```\r\n\r\nResult before:\r\n```\r\n_local/dictget.py:3: note: Revealed type is \"Union[builtins.str, None]\"\r\n```\r\n\r\nResult after:\r\n```\r\n_local/dictget.py:2: error: No overload variant of \"get\" of \"Mapping\" matches argument types \"str\", \"None\"\r\n_local/dictget.py:2: note: Possible overload variants:\r\n_local/dictget.py:2: note: def get(self, key: str) -> Optional[str]\r\n_local/dictget.py:2: note: def [_T] get(self, str, Union[str, _T]) -> Union[str, _T]\r\n_local/dictget.py:3: note: Revealed type is \"Any\"\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.920+dev.4996d571272adde83a3de2689c0147ca1be23f2c\r\n- Mypy command-line flags: (none)\r\n- Mypy configuration options from `mypy.ini` (and other config files): (none)\r\n- Python version used: 3.10.0\r\n- Operating system and version: macOS\r\n","author":{"url":"https://github.com/intgr","@type":"Person","name":"intgr"},"datePublished":"2021-11-30T13:22:45Z","url":"https://github.com/python/mypy/issues/11646"}
| 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:0d37230d-a166-5a32-ea80-721a1154918c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9FB2:3E7030:3AAE25:4F2413:6B002AB3 |
| html-safe-nonce | 5a1fd01a58819b78c6e652f73881fdb5c21efc574e6c03cffa99ae0b6c84db04 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RkIyOjNFNzAzMDozQUFFMjU6NEYyNDEzOjZCMDAyQUIzIiwidmlzaXRvcl9pZCI6IjMxMTgxNTkzOTY5OTYxMzE1MDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7ddd1acf17141833117b291eb97bad2f39f4a15fa54a1dff7e79141d444502ef |
| hovercard-subject-tag | issue:1067232579 |
| 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/11646/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1ccabb8a9de852b8939a0d7acde78da10caf13b78300f6b95caa8d5396704b2b/python/mypy/issues/11646 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1ccabb8a9de852b8939a0d7acde78da10caf13b78300f6b95caa8d5396704b2b/python/mypy/issues/11646 |
| og:image:alt | Bug Report After the latest sync from typeshed (commit 4996d57, PR #11600), this valid code is highlighted as error by mypy: def foo(vars: dict[str, str]): val = vars.get("fqdn", default=None) reve... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | intgr |
| 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