GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-85283: Extending Argument Clinic to support to use the limited C API. by shihai1991 · Pull Request #26080 · python/cpython

Conversation

@shihai1991

@shihai1991 shihai1991 commented May 12, 2021 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

https://bugs.python.org/issue41111

  • Issue: [C API] Convert a few stdlib extensions to the limited C API (PEP 384) #85283

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@shihai1991
Extending Argument Clinic to support to use the limited C API.
e1238ef
@bedevere-bot bedevere-bot added the awaiting review label May 12, 2021
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label May 12, 2021
@shihai1991 shihai1991 added the skip news label May 12, 2021
@shihai1991

shihai1991 commented May 12, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@shihai1991

shihai1991 commented May 13, 2021

Copy link
Copy Markdown
Member Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@shihai1991
shihai1991 requested review from larryhastings and vstinner May 13, 2021 01:09
@larryhastings

larryhastings commented May 14, 2021

Copy link
Copy Markdown
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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@shihai1991

shihai1991 commented May 14, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Jun 14, 2021

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Jun 14, 2021
MaxwellDupre

This comment was marked as off-topic.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added awaiting core review and removed awaiting review labels Mar 24, 2022
@serhiy-storchaka serhiy-storchaka added the topic-argument-clinic label Apr 30, 2022
serhiy-storchaka
serhiy-storchaka reviewed Apr 30, 2022
View reviewed changes
Comment thread Tools/clinic/clinic.py
else:
parser_code = [normalize_snippet("""
if (!PyArg_ParseTuple(args, "{format_units}:{name}",
if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser,

@serhiy-storchaka serhiy-storchaka Apr 30, 2022

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Why?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@shihai1991 shihai1991 Dec 18, 2022

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Tools/clinic/clinic.py
else:
declarations = (
'static const char * const _keywords[] = {{{keywords} NULL}};\n'
'static _PyArg_Parser _parser = {{"{format_units}:{name}", _keywords, 0}};')

@serhiy-storchaka serhiy-storchaka Apr 30, 2022

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@shihai1991 shihai1991 Dec 18, 2022

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ezio-melotti ezio-melotti removed the CLA signed label Jul 13, 2022
@github-actions github-actions Bot removed the stale Stale PR or inactive for long period of time. label Aug 7, 2022
This was referenced Nov 3, 2022
[C API] Convert a few stdlib extensions to the limited C API (PEP 384) #85283
Closed
/std:c++20 instead of /std:c++17 used for _wmimodule.cpp, but seems unnecessary #99191
Closed
@shihai1991 shihai1991 changed the title bpo-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

shihai1991 commented Dec 18, 2022

Copy link
Copy Markdown
Member Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@shihai1991 shihai1991 closed this Dec 18, 2022
@CAM-Gerlach

CAM-Gerlach commented Dec 20, 2022

Copy link
Copy Markdown
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
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland

erlend-aasland commented Jul 29, 2023

Copy link
Copy Markdown
Contributor

@shihai1991, are you interested in reviving this effort?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@shihai1991

shihai1991 commented Aug 4, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

@shihai1991, are you interested in reviving this effort?

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

erlend-aasland reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner vstinner mentioned this pull request Aug 25, 2023
Add support for the limited C API to Argument Clinic #108494
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@serhiy-storchaka serhiy-storchaka serhiy-storchaka left review comments
@vstinner vstinner Awaiting requested review from vstinner
@larryhastings larryhastings Awaiting requested review from larryhastings
+1 more reviewer
@MaxwellDupre MaxwellDupre MaxwellDupre approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting core review skip news topic-argument-clinic

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

9 participants

@shihai1991 @larryhastings @CAM-Gerlach @erlend-aasland @serhiy-storchaka @MaxwellDupre @the-knights-who-say-ni @ezio-melotti @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.