Title: (Partial) keyword argument forwarding · Issue #1524 · python/typing · GitHub
Open Graph Title: (Partial) keyword argument forwarding · Issue #1524 · python/typing
X Title: (Partial) keyword argument forwarding · Issue #1524 · python/typing
Description: Split from #1000. I have a similar use case with Ariadne middleware functions, but with kwargs. In Ariadne, a "resolver" function takes two positional arguments and a varying number of keyword arguments that depend on the API the resolve...
Open Graph Description: Split from #1000. I have a similar use case with Ariadne middleware functions, but with kwargs. In Ariadne, a "resolver" function takes two positional arguments and a varying number of keyword argu...
X Description: Split from #1000. I have a similar use case with Ariadne middleware functions, but with kwargs. In Ariadne, a "resolver" function takes two positional arguments and a varying number of ke...
Opengraph URL: https://github.com/python/typing/issues/1524
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"(Partial) keyword argument forwarding","articleBody":"Split from #1000.\r\n\r\n----\r\n\r\nI have a similar use case with [Ariadne middleware](https://ariadnegraphql.org/docs/middleware) functions, but with `kwargs`. In Ariadne, a \"resolver\" function takes two positional arguments and a varying number of keyword arguments that depend on the API the resolver implements. As the name implies, a middleware function sits between Ariadne and the resolver function and forwards arguments.\r\n\r\nIdeally, I would like to type a middleware function as follows:\r\n\r\n```python\r\n_P = ParamSpec(\"_P\")\r\n_R = TypeVar(\"_R\")\r\n_T = TypeVar(\"_T\")\r\n\r\ndef foo_middleware(\r\n resolver: Callable[Concatenate[_T, GraphQLResolveInfo, _P], _R],\r\n obj: _T,\r\n info: GraphQLResolveInfo,\r\n /,\r\n **kwargs: _P.kwargs,\r\n) -> _R:\r\n ...\r\n return resolver(obj, info, **kwargs)\r\n```\r\n\r\nBut currently this isn't possible, because `_P.args` is \"missing\".","author":{"url":"https://github.com/srittau","@type":"Person","name":"srittau"},"datePublished":"2023-12-06T11:26:23Z","url":"https://github.com/python/typing/issues/1524"}
| 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:63f6d953-cdd7-de09-529c-5dddb57fefcc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 96FC:144E47:2963F4B:363A9A1:6B0008D5 |
| html-safe-nonce | 5d2f5944158401bb4044f75ec61dde2a6080afc35b353345985d8b30c09b4a3d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NkZDOjE0NEU0NzoyOTYzRjRCOjM2M0E5QTE6NkIwMDA4RDUiLCJ2aXNpdG9yX2lkIjoiODg2MzY1MTUwNjY1NDU0NjEzMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a220822d4b04b000b6b17898ba6ac827f999c79d1c1c7fff2335170351f78d5d |
| hovercard-subject-tag | issue:2028329999 |
| 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/typing/1524/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ae3ad453bd47462192f60558be826b2d471f7afd7d6cc49591d995d18a282ae1/python/typing/issues/1524 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ae3ad453bd47462192f60558be826b2d471f7afd7d6cc49591d995d18a282ae1/python/typing/issues/1524 |
| og:image:alt | Split from #1000. I have a similar use case with Ariadne middleware functions, but with kwargs. In Ariadne, a "resolver" function takes two positional arguments and a varying number of keyword argu... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | srittau |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/typing git https://github.com/python/typing.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 24604008 |
| octolytics-dimension-repository_nwo | python/typing |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24604008 |
| octolytics-dimension-repository_network_root_nwo | python/typing |
| 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 | 16a11879678aaf97e2a42c33ee70830aa084fa37 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width