Title: PEP 692 (kwargs TypedDict) tracker · Issue #9710 · python/typeshed · GitHub
Open Graph Title: PEP 692 (kwargs TypedDict) tracker · Issue #9710 · python/typeshed
X Title: PEP 692 (kwargs TypedDict) tracker · Issue #9710 · python/typeshed
Description: Test example I'm using for support, from typing import TypedDict from typing_extensions import Unpack class Foo(TypedDict, total=False): a: int b: str def f(**kwargs: Unpack[Foo]) -> None: ... f(a=1, b="2") # OK f(a=1, b=2) # Error: b ha...
Open Graph Description: Test example I'm using for support, from typing import TypedDict from typing_extensions import Unpack class Foo(TypedDict, total=False): a: int b: str def f(**kwargs: Unpack[Foo]) -> None: ... f(a=...
X Description: Test example I'm using for support, from typing import TypedDict from typing_extensions import Unpack class Foo(TypedDict, total=False): a: int b: str def f(**kwargs: Unpack[Foo]) -> None: ....
Opengraph URL: https://github.com/python/typeshed/issues/9710
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PEP 692 (kwargs TypedDict) tracker","articleBody":"Test example I'm using for support,\r\n\r\n```python\r\nfrom typing import TypedDict\r\n\r\nfrom typing_extensions import Unpack\r\n\r\n\r\nclass Foo(TypedDict, total=False):\r\n a: int\r\n b: str\r\n\r\n\r\ndef f(**kwargs: Unpack[Foo]) -> None:\r\n ...\r\n\r\n\r\nf(a=1, b=\"2\") # OK\r\nf(a=1, b=2) # Error: b has type str\r\nf(a=1, b=\"2\", c=3) # Error: unexpected keyword argument \"c\"\r\n```\r\n\r\n- [x] mypy\r\n- [x] pyright\r\n- [ ] pytype google/pytype#1558\r\n- [x] pyre\r\n- [x] PyCharm (nice to have, but not required): Open [ticket](https://youtrack.jetbrains.com/issue/PY-55044).\r\n\r\npytype and pyre both produce 1 error on `f(**kwargs: Unpack[Foo]) `. Pytype produces `typing_extensions.Unpack not supported yet [not-supported-yet]` while pyre produces `pep_692.py:11:16 Undefined or invalid type [11]: Annotation Unpack is not defined as a type.` \r\n\r\nUnsure if typeshed usage for this should wait til pyre/pytype fully support pep 692 or if current status of them not checking lines reliant on 692 is enough (similar to Self type [status](https://github.com/python/typeshed/issues/6300)). pytype/pyre still detect errors normally for other parts of the file.\r\n\r\nFor mypy side we would also need to adjust line with [mypy flags](https://github.com/python/typeshed/blob/52cf716831ea11c08741db5f07ed740b3c9714c2/tests/mypy_test.py#L252) to include --enable-incomplete-feature=Unpack (maybe other incomplete features should be considered too).\r\n\r\nMotivation for issue was yesterday I hit some lines in tensorflow stub where 692 would be helpful. Minor though and being explicit on arguments works fine (just adds a couple stubtest allowlist lines).","author":{"url":"https://github.com/hmc-cs-mdrissi","@type":"Person","name":"hmc-cs-mdrissi"},"datePublished":"2023-02-11T07:40:00Z","url":"https://github.com/python/typeshed/issues/9710"}
| 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:69650dff-9b81-2273-6b2d-851e20b517e4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CB9A:197995:22BD4DE:2F2A423:6B002914 |
| html-safe-nonce | cbaf00323ff03da1be8d49c9373d607c8b2aa26c76192f08fa6f345195976af7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQjlBOjE5Nzk5NToyMkJENERFOjJGMkE0MjM6NkIwMDI5MTQiLCJ2aXNpdG9yX2lkIjoiOTUyNzQ1OTk4OTczNzcwNDQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 93d80f741c6b1e3bc4ca3c0bdeb4d70567a7d16cfe55c7615e80bc022e625f56 |
| hovercard-subject-tag | issue:1580711530 |
| 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/9710/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7c854c17e996ae96a06b66be4d26e501e2a63be6f1e124a0619107eb4ad0bd50/python/typeshed/issues/9710 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7c854c17e996ae96a06b66be4d26e501e2a63be6f1e124a0619107eb4ad0bd50/python/typeshed/issues/9710 |
| og:image:alt | Test example I'm using for support, from typing import TypedDict from typing_extensions import Unpack class Foo(TypedDict, total=False): a: int b: str def f(**kwargs: Unpack[Foo]) -> None: ... f(a=... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hmc-cs-mdrissi |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0 |
| 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 | 44c658b24abf00491fb7ae5f56d42c9f38cbeab2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width