Title: Make it possible to mark Argument Clinic args as unused · Issue #104389 · python/cpython · GitHub
Open Graph Title: Make it possible to mark Argument Clinic args as unused · Issue #104389 · python/cpython
X Title: Make it possible to mark Argument Clinic args as unused · Issue #104389 · python/cpython
Description: For base classes, it is not unusual to create stubs for interface methods, and let those stubs simply raise an exception. It would be nice to be able to mark the arguments with Py_UNUSED in those cases. Implementing this is straight-forw...
Open Graph Description: For base classes, it is not unusual to create stubs for interface methods, and let those stubs simply raise an exception. It would be nice to be able to mark the arguments with Py_UNUSED in those c...
X Description: For base classes, it is not unusual to create stubs for interface methods, and let those stubs simply raise an exception. It would be nice to be able to mark the arguments with Py_UNUSED in those c...
Opengraph URL: https://github.com/python/cpython/issues/104389
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Make it possible to mark Argument Clinic args as unused","articleBody":"For base classes, it is not unusual to create stubs for interface methods, and let those stubs simply raise an exception. It would be nice to be able to mark the arguments with Py\\_UNUSED in those cases.\r\n\r\nImplementing this is straight-forward in clinic.py. CConverter get's a new keyword argument `unused` which defaults to `False`, and we can write code like this:\r\n\r\n```\r\n/*[clinic input]\r\n_io._TextIOBase.read\r\n cls: defining_class\r\n size: int(unused=True) = -1\r\n[clinic start generated code]*/\r\n```\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-104390\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/erlend-aasland","@type":"Person","name":"erlend-aasland"},"datePublished":"2023-05-11T12:47:49.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/104389/cpython/issues/104389"}
| 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:0ecb67b5-cdc1-9cba-05db-b5b92220f85a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BF68:256A62:500432:6CAB1F:6969D9F5 |
| html-safe-nonce | 92d36cf9dc8e9b2fe34b7a1240a3f1d36aa38a58861636ae943efb40a6cf78ba |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRjY4OjI1NkE2Mjo1MDA0MzI6NkNBQjFGOjY5NjlEOUY1IiwidmlzaXRvcl9pZCI6IjIzODU5MTA3NjE5NzY4Nzk2MDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d0e9476ef23c8e09fd5392616e0725b47cad30df1e66ece08e1ae3a60d6f7465 |
| hovercard-subject-tag | issue:1705761427 |
| 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/104389/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2c133269eee3671df85cd665abd07102dc35b19b5d7906990e894da7f2fe606d/python/cpython/issues/104389 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2c133269eee3671df85cd665abd07102dc35b19b5d7906990e894da7f2fe606d/python/cpython/issues/104389 |
| og:image:alt | For base classes, it is not unusual to create stubs for interface methods, and let those stubs simply raise an exception. It would be nice to be able to mark the arguments with Py_UNUSED in those c... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | erlend-aasland |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7b32f1c7c4549428ee399213e8345494fc55b5637195d3fc5f493657579235e8 |
| 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 | bdde15ad1b403e23b08bbd89b53fbe6bdf688cad |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width