Title: Representation of ParamSpecs at runtime compared to Callable · Issue #102615 · python/cpython · GitHub
Open Graph Title: Representation of ParamSpecs at runtime compared to Callable · Issue #102615 · python/cpython
X Title: Representation of ParamSpecs at runtime compared to Callable · Issue #102615 · python/cpython
Description: I think a list representation is more consistent with the text of PEP 612 and the runtime representation of Callable. We should change the runtime repr of ParamSpec generics to be more like Callable, because right now they're inconsisten...
Open Graph Description: I think a list representation is more consistent with the text of PEP 612 and the runtime representation of Callable. We should change the runtime repr of ParamSpec generics to be more like Callabl...
X Description: I think a list representation is more consistent with the text of PEP 612 and the runtime representation of Callable. We should change the runtime repr of ParamSpec generics to be more like Callabl...
Opengraph URL: https://github.com/python/cpython/issues/102615
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Representation of ParamSpecs at runtime compared to Callable","articleBody":" I think a list representation is more consistent with the text of PEP 612 and the runtime representation of Callable. We should change the runtime repr of ParamSpec generics to be more like Callable, because right now they're inconsistent:\r\n\r\n```\r\n\u003e\u003e\u003e Callable[[int, str], bool]\r\ntyping.Callable[[int, str], bool]\r\n\u003e\u003e\u003e P = ParamSpec(\"P\")\r\n\u003e\u003e\u003e T = TypeVar(\"T\")\r\n\u003e\u003e\u003e class MyCallable(Generic[P, T]): pass\r\n... \r\n\u003e\u003e\u003e MyCallable[[int, str], bool]\r\n__main__.MyCallable[(\u003cclass 'int'\u003e, \u003cclass 'str'\u003e), bool]\r\n\u003e\u003e\u003e get_args(Callable[[int, str], bool])\r\n([\u003cclass 'int'\u003e, \u003cclass 'str'\u003e], \u003cclass 'bool'\u003e)\r\n\u003e\u003e\u003e get_args(MyCallable[[int, str], bool])\r\n((\u003cclass 'int'\u003e, \u003cclass 'str'\u003e), \u003cclass 'bool'\u003e)\r\n```\r\n\r\n_Originally posted by @JelleZijlstra in https://github.com/python/typing/issues/1274#issuecomment-1288302661_\r\n \n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-102637\n* gh-102681\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/Gobot1234","@type":"Person","name":"Gobot1234"},"datePublished":"2023-03-12T00:13:57.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":14},"url":"https://github.com/102615/cpython/issues/102615"}
| 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:6a2242df-0c0b-cddc-108e-e4ce9e07bd28 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EDA0:8907F:8DA5F:C8265:696A4670 |
| html-safe-nonce | 65a3f3ff50c803d63ebbfbf4bcab40f71d787754bc82184179842ea16243af60 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFREEwOjg5MDdGOjhEQTVGOkM4MjY1OjY5NkE0NjcwIiwidmlzaXRvcl9pZCI6IjY1OTkxMzMzNDQzMjg3NjE0NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 304195473f7ab17a9de1ee46024bbb8276fa32c2a1efdf1d40401d925c770e11 |
| hovercard-subject-tag | issue:1620185091 |
| 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/cpython/102615/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9fb91f902e9691f501b9bc18d26e8cd990a979daae032a6f9c0a1185a05f5e58/python/cpython/issues/102615 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9fb91f902e9691f501b9bc18d26e8cd990a979daae032a6f9c0a1185a05f5e58/python/cpython/issues/102615 |
| og:image:alt | I think a list representation is more consistent with the text of PEP 612 and the runtime representation of Callable. We should change the runtime repr of ParamSpec generics to be more like Callabl... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Gobot1234 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3f871c8e07f0ae1886fa8dac284166d28b09ad5bada6476fc10b674e489788ef |
| turbo-cache-control | no-preview |
| 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 | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 63c426b30d262aba269ef14c40e3c817b384cd61 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width