René's URL Explorer Experiment


Title: Argument Clinic includes internal headers in generated output unconditionally · Issue #107603 · python/cpython · GitHub

Open Graph Title: Argument Clinic includes internal headers in generated output unconditionally · Issue #107603 · python/cpython

X Title: Argument Clinic includes internal headers in generated output unconditionally · Issue #107603 · python/cpython

Description: It seems like Argument Clinic generates code that define Py_BUILD_CORE and includes internal headers unconditionally; for example, a file with a METH_O function will have no need for those: Details /*[clinic input] preserve [clinic start...

Open Graph Description: It seems like Argument Clinic generates code that define Py_BUILD_CORE and includes internal headers unconditionally; for example, a file with a METH_O function will have no need for those: Details...

X Description: It seems like Argument Clinic generates code that define Py_BUILD_CORE and includes internal headers unconditionally; for example, a file with a METH_O function will have no need for those: Details...

Opengraph URL: https://github.com/python/cpython/issues/107603

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Argument Clinic includes internal headers in generated output unconditionally","articleBody":"It seems like Argument Clinic generates code that define `Py_BUILD_CORE` and includes internal headers unconditionally; for example, a file with a `METH_O` function will have no need for those:\r\n\r\n\u003cdetails\u003e\r\n\r\n```c\r\n/*[clinic input]\r\npreserve\r\n[clinic start generated code]*/\r\n\r\n#if defined(Py_BUILD_CORE) \u0026\u0026 !defined(Py_BUILD_CORE_MODULE)\r\n#  include \"pycore_gc.h\"            // PyGC_Head\r\n#  include \"pycore_runtime.h\"       // _Py_ID()\r\n#endif\r\n\r\n\r\nPyDoc_STRVAR(func__doc__,\r\n\"func($module, a, /)\\n\"\r\n\"--\\n\"\r\n\"\\n\");\r\n\r\n#define FUNC_METHODDEF    \\\r\n    {\"func\", (PyCFunction)func, METH_O, func__doc__},\r\n/*[clinic end generated code: output=851b6645c29cfa0d input=a9049054013a1b77]*/\r\n```\r\n\r\n\u003c/details\u003e\r\n\r\nOTOH, a `METH_KEYWORDS` function needs those:\r\n\r\n\u003cdetails\u003e\r\n\r\n```c\r\n/*[clinic input]\r\npreserve\r\n[clinic start generated code]*/\r\n\r\n#if defined(Py_BUILD_CORE) \u0026\u0026 !defined(Py_BUILD_CORE_MODULE)\r\n#  include \"pycore_gc.h\"            // PyGC_Head\r\n#  include \"pycore_runtime.h\"       // _Py_ID()\r\n#endif\r\n\r\n\r\nPyDoc_STRVAR(func__doc__,\r\n\"func($module, /, a, b)\\n\"\r\n\"--\\n\"\r\n\"\\n\");\r\n\r\n#define FUNC_METHODDEF    \\\r\n    {\"func\", _PyCFunction_CAST(func), METH_FASTCALL|METH_KEYWORDS, func__doc__},\r\n\r\nstatic PyObject *\r\nfunc_impl(PyObject *module, PyObject *a, PyObject *b);\r\n\r\nstatic PyObject *\r\nfunc(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)\r\n{\r\n    PyObject *return_value = NULL;\r\n    #if defined(Py_BUILD_CORE) \u0026\u0026 !defined(Py_BUILD_CORE_MODULE)\r\n\r\n    #define NUM_KEYWORDS 2\r\n    static struct {\r\n        PyGC_Head _this_is_not_used;\r\n        PyObject_VAR_HEAD\r\n        PyObject *ob_item[NUM_KEYWORDS];\r\n    } _kwtuple = {\r\n        .ob_base = PyVarObject_HEAD_INIT(\u0026PyTuple_Type, NUM_KEYWORDS)\r\n        .ob_item = { \u0026_Py_ID(a), \u0026_Py_ID(b), },\r\n    };\r\n    #undef NUM_KEYWORDS\r\n    #define KWTUPLE (\u0026_kwtuple.ob_base.ob_base)\r\n\r\n    #else  // !Py_BUILD_CORE\r\n    #  define KWTUPLE NULL\r\n    #endif  // !Py_BUILD_CORE\r\n\r\n    static const char * const _keywords[] = {\"a\", \"b\", NULL};\r\n    static _PyArg_Parser _parser = {\r\n        .keywords = _keywords,\r\n        .fname = \"func\",\r\n        .kwtuple = KWTUPLE,\r\n    };\r\n    #undef KWTUPLE\r\n    PyObject *argsbuf[2];\r\n    PyObject *a;\r\n    PyObject *b;\r\n\r\n    args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, \u0026_parser, 2, 2, 0, argsbuf);\r\n    if (!args) {\r\n        goto exit;\r\n    }\r\n    a = args[0];\r\n    b = args[1];\r\n    return_value = func_impl(module, a, b);\r\n\r\nexit:\r\n    return return_value;\r\n}\r\n/*[clinic end generated code: output=e790cd95ffc517a0 input=a9049054013a1b77]*/\r\n```\r\n\r\n\u003c/details\u003e\r\n\r\nArgument Clinic should check if those defines/includes are needed before generating the output.\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-108486\n* gh-108581\n* gh-108715\n* gh-108726\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/erlend-aasland","@type":"Person","name":"erlend-aasland"},"datePublished":"2023-08-03T20:39:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/107603/cpython/issues/107603"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:ce0272c4-c26d-8936-5932-ddf403556a65
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idEBFE:10503:171CCDE:1DFD375:696B25CA
html-safe-nonceb12bbcf23741f60bc753b04f855023cad89ae1bdfeef3e1c2d6633a7afdf33be
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQkZFOjEwNTAzOjE3MUNDREU6MURGRDM3NTo2OTZCMjVDQSIsInZpc2l0b3JfaWQiOiI3MTQ2OTQ5MDk2OTgyMTI4MDc0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac9493cbabc04918a93c5c67f29112a8885ed1f6afec9287b9930759b3e1512c12
hovercard-subject-tagissue:1835705555
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/107603/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c0dd938aebcabdad458da8579c8bb3a19a766db3146521aefb46b8ad900d204b/python/cpython/issues/107603
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c0dd938aebcabdad458da8579c8bb3a19a766db3146521aefb46b8ad900d204b/python/cpython/issues/107603
og:image:altIt seems like Argument Clinic generates code that define Py_BUILD_CORE and includes internal headers unconditionally; for example, a file with a METH_O function will have no need for those: Details...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameerlend-aasland
hostnamegithub.com
expected-hostnamegithub.com
None5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release82560a55c6b2054555076f46e683151ee28a19bc
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/issues/107603#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F107603
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F107603
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/107603
Reloadhttps://github.com/python/cpython/issues/107603
Reloadhttps://github.com/python/cpython/issues/107603
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/issues/107603
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.1k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/cpython/security
Please reload this pagehttps://github.com/python/cpython/issues/107603
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/107603
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/107603
Argument Clinic includes internal headers in generated output unconditionallyhttps://github.com/python/cpython/issues/107603#top
topic-argument-clinichttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-argument-clinic%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/erlend-aasland
https://github.com/erlend-aasland
erlend-aaslandhttps://github.com/erlend-aasland
on Aug 3, 2023https://github.com/python/cpython/issues/107603#issue-1835705555
gh-107603: Argument Clinic can emit includes #108486https://github.com/python/cpython/pull/108486
GH-107603: Clinic: Pass specific attributes to print_block() #108581https://github.com/python/cpython/pull/108581
gh-107603: AC only includes pycore_gc.h if needed #108715https://github.com/python/cpython/pull/108715
gh-107603: Argument Clinic: Only include pycore_gc.h if needed #108726https://github.com/python/cpython/pull/108726
topic-argument-clinichttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-argument-clinic%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.