Title: wrong positional-or-keyword information in `Mapping` and `MutableMapping` · Issue #13432 · python/typeshed · GitHub
Open Graph Title: wrong positional-or-keyword information in `Mapping` and `MutableMapping` · Issue #13432 · python/typeshed
X Title: wrong positional-or-keyword information in `Mapping` and `MutableMapping` · Issue #13432 · python/typeshed
Description: Mapping and MutableMapping information for get and pop says that the default parameter is positional or keyword. dict says positional only, and that is correct at runtime. So this type checks with no errors, but crashes with TypeError: f...
Open Graph Description: Mapping and MutableMapping information for get and pop says that the default parameter is positional or keyword. dict says positional only, and that is correct at runtime. So this type checks with ...
X Description: Mapping and MutableMapping information for get and pop says that the default parameter is positional or keyword. dict says positional only, and that is correct at runtime. So this type checks with ...
Opengraph URL: https://github.com/python/typeshed/issues/13432
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"wrong positional-or-keyword information in `Mapping` and `MutableMapping`","articleBody":"`Mapping` and `MutableMapping` information for `get` and `pop` says that the `default` parameter is positional or keyword.\n\n`dict` says positional only, and that is correct at runtime.\n\nSo this type checks with no errors, but crashes with `TypeError`:\n```python\nfrom collections.abc import Mapping, MutableMapping\n\n\ndef foo(x: MutableMapping[str, int]) -> int:\n return x.pop(\"3\", default=3)\n\n\nfoo({}) # crash: TypeError: dict.pop() takes no keyword arguments\n\n\ndef goo(x: Mapping[str, int]) -> int:\n return x.get(\"3\", default=3)\n\n\ngoo({}) # crash: TypeError: dict.get() takes no keyword arguments\n\n\n# same with MutableMapping.get\n```","author":{"url":"https://github.com/beauxq","@type":"Person","name":"beauxq"},"datePublished":"2025-01-24T14:23:17Z","url":"https://github.com/python/typeshed/issues/13432"}
| 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:b013f885-d81e-cc05-b516-6822f0e1aa8a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BA5C:1FB2:159E094:1DC0557:6B0043A0 |
| html-safe-nonce | 3b66a9c839d92c41a4c5819f49629d5c0e3220a69abdf35d2a6a980af0499e9a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQTVDOjFGQjI6MTU5RTA5NDoxREMwNTU3OjZCMDA0M0EwIiwidmlzaXRvcl9pZCI6IjEwNjgzMTkxMDc0NjE0MzIyMjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a9a65711e2e0bb073ca51752e2b51bb1d0920a1157d1c0583b1835300e5d7aae |
| hovercard-subject-tag | issue:2809582226 |
| 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/typeshed/13432/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b7de08de8e75fffbe26fe5c14d1c3088a051aafecd9710abbf60f8e75d1b9029/python/typeshed/issues/13432 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b7de08de8e75fffbe26fe5c14d1c3088a051aafecd9710abbf60f8e75d1b9029/python/typeshed/issues/13432 |
| og:image:alt | Mapping and MutableMapping information for get and pop says that the default parameter is positional or keyword. dict says positional only, and that is correct at runtime. So this type checks with ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | beauxq |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/typeshed git https://github.com/python/typeshed.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 31696383 |
| octolytics-dimension-repository_nwo | python/typeshed |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31696383 |
| octolytics-dimension-repository_network_root_nwo | python/typeshed |
| 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