Title: Improve MutableMapping.update's overloads to reflect relationship between key type and **kwargs · Issue #12456 · python/typeshed · GitHub
Open Graph Title: Improve MutableMapping.update's overloads to reflect relationship between key type and **kwargs · Issue #12456 · python/typeshed
X Title: Improve MutableMapping.update's overloads to reflect relationship between key type and **kwargs · Issue #12456 · python/typeshed
Description: The current overloads for MutableMapping.update() allow the use of keyword arguments even if the key type isn't str. I think it's possible to put a type hint on self so that keyword arguments only pass type checking when the key type is ...
Open Graph Description: The current overloads for MutableMapping.update() allow the use of keyword arguments even if the key type isn't str. I think it's possible to put a type hint on self so that keyword arguments only ...
X Description: The current overloads for MutableMapping.update() allow the use of keyword arguments even if the key type isn't str. I think it's possible to put a type hint on self so that keyword argumen...
Opengraph URL: https://github.com/python/typeshed/issues/12456
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Improve MutableMapping.update's overloads to reflect relationship between key type and **kwargs","articleBody":"The current overloads for MutableMapping.update() allow the use of keyword arguments even if the key type isn't str. I think it's possible to put a type hint on self so that keyword arguments only pass type checking when the key type is str, like this.\r\n\r\n```python\r\n # **kwargs aren't allowed for general _KT\r\n @overload\r\n def update(self, m: SupportsKeysAndGetItem[_KT, _VT], /) -> None: ...\r\n @overload\r\n def update(self, m: Iterable[tuple[_KT, _VT]], /) -> None: ...\r\n # **kwargs are allowed when _KT is str\r\n @overload\r\n def update(self: MutableMapping[str, _VT], m: SupportsKeysAndGetItem[_KT, _VT], /, **kwargs: _VT) -> None: ...\r\n @overload\r\n def update(self: MutableMapping[str, _VT], m: Iterable[tuple[_KT, _VT]], /, **kwargs: _VT) -> None: ...\r\n @overload\r\n def update(self: MutableMapping[str, _VT], **kwargs: _VT) -> None: ...\r\n```\r\n\r\nSee the current overloads for MutableMapping.update here: https://github.com/python/typeshed/blob/3db7f01a31cb60e436ac5e0cc00e10b9a8a2cfe2/stdlib/typing.pyi#L749-L754","author":{"url":"https://github.com/cfriedland5","@type":"Person","name":"cfriedland5"},"datePublished":"2024-07-27T21:21:58Z","url":"https://github.com/python/typeshed/issues/12456"}
| 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:16d4d4cc-5970-8050-d9fb-e6f90709949a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C6AA:30263F:24FC925:3265E60:6B003812 |
| html-safe-nonce | 1f3021c6e7db697af1ca540ac71fcbaafcf6d2fe42fa84207be3ea53ee698dfd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNkFBOjMwMjYzRjoyNEZDOTI1OjMyNjVFNjA6NkIwMDM4MTIiLCJ2aXNpdG9yX2lkIjoiODAzMzIwODc0Mzc3MDQ3MDQxOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | aa2ad129c4ee68461948e5a2217e37c9733a59c99f0dfe4173f24c44efcd5c7a |
| hovercard-subject-tag | issue:2433629681 |
| 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/12456/issue_layout |
| twitter:image | https://opengraph.githubassets.com/be6df6112b2d3acd63809608ef97b59f3bcd533e9278afdab019f51db6549af4/python/typeshed/issues/12456 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/be6df6112b2d3acd63809608ef97b59f3bcd533e9278afdab019f51db6549af4/python/typeshed/issues/12456 |
| og:image:alt | The current overloads for MutableMapping.update() allow the use of keyword arguments even if the key type isn't str. I think it's possible to put a type hint on self so that keyword arguments only ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | cfriedland5 |
| 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