Title: Remove `ConverterKeywordDict` alias in `clinic.py` by sobolevn · Pull Request #115843 · python/cpython · GitHub
Open Graph Title: Remove `ConverterKeywordDict` alias in `clinic.py` by sobolevn · Pull Request #115843 · python/cpython
X Title: Remove `ConverterKeywordDict` alias in `clinic.py` by sobolevn · Pull Request #115843 · python/cpython
Description: Context: python/mypy#16939 (comment) New mypy version detected this typing problem: dict[str, TypeSet | bool] is not the correct type for **kwargs of str_converter.__init__: CPython (Argument Clinic) (https://github.com/python/cpython) + Tools/clinic/clinic.py:4094: error: Argument 1 to "str_converter" has incompatible type "**dict[str, set[type[object]] | bool]"; expected "str" [arg-type] + Tools/clinic/clinic.py:4094: error: Argument 1 to "str_converter" has incompatible type "**dict[str, set[type[object]] | bool]"; expected "Function" [arg-type] + Tools/clinic/clinic.py:4094: error: Argument 1 to "str_converter" has incompatible type "**dict[str, set[type[object]] | bool]"; expected "str | None" [arg-type] + Tools/clinic/clinic.py:4094: error: Argument 1 to "str_converter" has incompatible type "**dict[str, set[type[object]] | bool]"; expected "str | Literal[Sentinels.unspecified]" [arg-type] + Tools/clinic/clinic.py:4094: error: Argument 1 to "str_converter" has incompatible type "**dict[str, set[type[object]] | bool]"; expected "bool" [arg-type] (the error message looks cryptic). str_converter.__init__ has this type: def __init__(self, # Positional args: name: str, py_name: str, function: Function, default: object = unspecified, *, # Keyword only args: c_default: str | None = None, py_default: str | None = None, annotation: str | Literal[Sentinels.unspecified] = unspecified, unused: bool = False, **kwargs: Any ) -> None: So, basically you can only say that **kwargs can be dict[str, Any]. This is why I removed this alias.
Open Graph Description: Context: python/mypy#16939 (comment) New mypy version detected this typing problem: dict[str, TypeSet | bool] is not the correct type for **kwargs of str_converter.__init__: CPython (Argument Clini...
X Description: Context: python/mypy#16939 (comment) New mypy version detected this typing problem: dict[str, TypeSet | bool] is not the correct type for **kwargs of str_converter.__init__: CPython (Argument Clini...
Opengraph URL: https://github.com/python/cpython/pull/115843
X: @github
Domain: github.com
| 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 | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:356fba0a-b282-0090-ce80-031b0687c47a |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E3D4:278022:F7F0FE:1448499:6B00018A |
| html-safe-nonce | 5bd24d8aeb1a5a0aeeb7945299cb1bcf96ccbe1d3de3c97f5762098a2e884a9c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFM0Q0OjI3ODAyMjpGN0YwRkU6MTQ0ODQ5OTo2QjAwMDE4QSIsInZpc2l0b3JfaWQiOiI2MDEzNTMyNDIxODcyNDE5MjEwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 8dbdbca6698b98e498f76c7eee9e8936023973b1396b06da7ce23d2633088bee |
| hovercard-subject-tag | pull_request:1740294060 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/python/cpython/pull/115843/files |
| twitter:image | https://avatars.githubusercontent.com/u/4660275?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/4660275?s=400&v=4 |
| og:image:alt | Context: python/mypy#16939 (comment) New mypy version detected this typing problem: dict[str, TypeSet | bool] is not the correct type for **kwargs of str_converter.__init__: CPython (Argument Clini... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| 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 |
Links:
Viewport: width=device-width