Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-85283: Extending Argument Clinic to support to use the limited C API.#26080

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
shihai1991 wants to merge1 commit intopython:mainfromshihai1991:bpo_41111_3

Conversation

shihai1991
Copy link
Member

@shihai1991shihai1991 commentedMay 12, 2021
edited by bedevere-bot
Loading

@shihai1991
Copy link
MemberAuthor

shihai1991 commentedMay 12, 2021
edited
Loading

python3 Tools/clinic/clinic.py --limited_api Modules/posixmodule.c

The test of Argument Clinic in:https://github.com/shihai1991/cpython/compare/main...shihai1991:clinic_support_limited_capi?expand=1

@shihai1991
Copy link
MemberAuthor

@larryhastings Hi, Larry. Would you mind to take a look? cc@vstinner

@larryhastings
Copy link
Contributor

Before I look at the patch: what is the purpose of it? Argument Clinic is an internal tool for CPython, it can use the full API.

@shihai1991
Copy link
MemberAuthor

shihai1991 commentedMay 14, 2021
edited
Loading

Before I look at the patch: what is the purpose of it? Argument Clinic is an internal tool for CPython, it can use the full API.

Yes. The Argument Clinic can use the full API. So this PR add an option to allow developer to use the limited C API or not.
What's the benefit of using the limited C API? It can hide the implementation details of the C API and more easy to extend.

More details in:
PEP 620:https://www.python.org/dev/peps/pep-0620/#relationship-with-the-limited-c-api
some victor's comment:https://bugs.python.org/issue41111#msg372307

@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actionsgithub-actionsbot added the staleStale PR or inactive for long period of time. labelJun 14, 2021
MaxwellDupre

This comment was marked as off-topic.

@@ -887,7 +895,7 @@ def parser_body(prototype, *fields, declarations=''):
""", indent=4)]
else:
parser_code = [normalize_snippet("""
if (!PyArg_ParseTuple(args,"{format_units}:{name}",
if (!_PyArg_ParseTupleAndKeywordsFast(args,kwargs, &_parser,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Why?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Use the limited C API when using the use_limited_api flag, otherwise it'll use the unlimited C API.

Sorry for my delay.

else:
declarations = (
'static const char * const _keywords[] = {{{keywords} NULL}};\n'
'static _PyArg_Parser _parser = {{"{format_units}:{name}", _keywords, 0}};')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This is not in the Limited API.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

OK, you are right. Thanks.

@github-actionsgithub-actionsbot removed the staleStale PR or inactive for long period of time. labelAug 7, 2022
@shihai1991shihai1991 changed the titlebpo-41111: Extending Argument Clinic to support to use the limited C API.gh-85283: Extending Argument Clinic to support to use the limited C API.Dec 18, 2022
@shihai1991
Copy link
MemberAuthor

After PEP 620 canceled, so I decide close this PR. I will reopen this PR when we continue update PEP 620, ref:python/peps#2923
Thanks Mike, Serhiy for your review.

@CAM-Gerlach
Copy link
Member

@vstinner would of course know best, but my impression of the intent of withdrawing PEP 620 was that neither would it be re-opened and updated later or nor would the remaining changes be abandoned (as most of them were completed or mostly completed already), but rather they would be broken up into smaller separate PEPs.

shihai1991 reacted with eyes emoji

@erlend-aasland
Copy link
Contributor

@shihai1991, are you interested in reviving this effort?

@shihai1991
Copy link
MemberAuthor

shihai1991 commentedAug 4, 2023
edited
Loading

@shihai1991, are you interested in reviving this effort?

Sure, of course. Sorry for my late replay ;)

erlend-aasland reacted with heart emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@serhiy-storchakaserhiy-storchakaserhiy-storchaka left review comments

@MaxwellDupreMaxwellDupreMaxwellDupre approved these changes

@vstinnervstinnerAwaiting requested review from vstinner

@larryhastingslarryhastingsAwaiting requested review from larryhastings

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

9 participants
@shihai1991@larryhastings@CAM-Gerlach@erlend-aasland@serhiy-storchaka@MaxwellDupre@the-knights-who-say-ni@ezio-melotti@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp