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-133678: Add a banner to C API doc to recommend 3rd party tools#133679

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
vstinner wants to merge7 commits intopython:mainfromvstinner:c_api_banner

Conversation

vstinner
Copy link
Member

@vstinnervstinner commentedMay 8, 2025
edited
Loading

encukou reacted with thumbs down emoji
@vstinner
Copy link
MemberAuthor

Banner added to all pages (the gray note):

Screenshot 2025-05-08 at 17-50-23 Python_C API Reference Manual — Python 3 15 0a0 documentation


Link to this new section:

Screenshot 2025-05-08 at 17-51-19 Introduction — Python 3 15 0a0 documentation

@zooba
Copy link
Member

I think we'll need a bit more nuance in here, explaining why we still have a C API at all if we're telling people not to use it (obvious to us, not obvious to someone who happens to be reading these docs for the first time).

efimov-mikhail, pganssle, and erlend-aasland reacted with thumbs up emoji

@efimov-mikhail
Copy link
Contributor

I think we'll need a bit more nuance in here, explaining why we still have a C API at all if we're telling people not to use it (obvious to us, not obvious to someone who happens to be reading these docs for the first time).

Totally agree. For example, I've personally taken a lot of information from the last discuss thread. It seems to be very useful to document these nuances in concise manner.

@zooba
Copy link
Member

I also think we need to be careful to indicate that these are not supported by the same people who maintain Python, and issues need to be raised with the projects directly.

@philthompson10
Copy link

...and, by implication, other abstractions arenot recommended?

@vstinner
Copy link
MemberAuthor

@zooba: I elaborated the rationale a little bit in the "Recommended third party tools" section. Feel free to propose better wording, I'm not good to write documentation :-)

https://cpython-previews--133679.org.readthedocs.build/en/133679/c-api/intro.html#recommended-third-party-tools

@vstinner
Copy link
MemberAuthor

...and, by implication, other abstractions are not recommended?

It's not the case. Did I miss some major abstractions in my list?

@philthompson10
Copy link

The list is at least inconsistent withhttps://docs.python.org/dev/faq/extending.html#writing-c-is-hard-are-there-any-alternatives

However my problem is with the wordrecommended which implies some sort of official blessing which would put new (possibly better) abstractions at a disadvantage and implies some quality control process. I'd prefer something likeestablished orcommonly used.

@efimov-mikhail
Copy link
Contributor

However my problem is with the wordrecommended which implies some sort of official blessing which would put new (possibly better) abstractions at a disadvantage and implies some quality control process.

IMO, this is actually arecommended API for the most of the projects. There is no direct implication that other abstraction could not be better in future. In fact, it's not a problem to add a new entry to this list, if some project had proven as a well-established alternative.

But at the moment a maintainer of some project can use C API directly or through some binding. And CPython developers encourage that maintainer to use the latter.

vstinnerand others added3 commitsMay 9, 2025 07:44
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
@vstinnervstinner changed the titlegh-133678: Add a banner to C API doc to recommend toolsgh-133678: Add a banner to C API doc to recommend 3rd party toolsMay 9, 2025
Copy link
Contributor

@ncoghlanncoghlan left a comment

Choose a reason for hiding this comment

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

Suggested an adjustment to the banner wording. The intro tohttps://docs.python.org/3/extending/index.html should also be updated (potentially replacing the existing 3rd party tool list there and cross-referencing it from the C API intro rather than making a new separate list in the C API docs intro)

Comment on lines +268 to +269
class CAPIToolsBanner(SphinxDirective):
"""CAPI Tools banner."""
Copy link
Member

Choose a reason for hiding this comment

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

From an implementation perspective, it would be better to use an.. include:: directive rather than adding custom code here.

I don't have a strong opinion on the banner in general, but I wonder if adding it to every page is a bit much? I defer to the C API group for deliberations here, though.

A

Copy link
Contributor

Choose a reason for hiding this comment

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

We've had the existing note in the extending/embedding intro for a long time, but it doesn't really work for anyone coming in from a deep link (including search results). A banner seems like a plausible improvement.

Given the possibility of anchor targets dropping people in well down the pages, though, I do wonder if a hovering banner like the ones added to finalised PEPs might be a better technical approach.

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
@brettcannonbrettcannon removed their request for reviewMay 12, 2025 19:50
@kumaraditya303kumaraditya303 removed their request for reviewMay 21, 2025 09:39
@vstinner
Copy link
MemberAuthor

@encukou isagainst the banner, so I wrote a simpler PR just to add a section to the C API Introduction, and modify existing text to point to this section:#134526.

encukou reacted with heart emoji

@vstinnervstinner deleted the c_api_banner branchMay 22, 2025 16:45
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ncoghlanncoghlanncoghlan left review comments

@zoobazoobazooba left review comments

@AA-TurnerAA-TurnerAA-Turner left review comments

@terryjreedyterryjreedyterryjreedy left review comments

@efimov-mikhailefimov-mikhailefimov-mikhail approved these changes

@encukouencukouAwaiting requested review from encukouencukou is a code owner

@pgansslepganssleAwaiting requested review from pgansslepganssle is a code owner

@abalkinabalkinAwaiting requested review from abalkinabalkin is a code owner

@ericsnowcurrentlyericsnowcurrentlyAwaiting requested review from ericsnowcurrentlyericsnowcurrently is a code owner

@warsawwarsawAwaiting requested review from warsawwarsaw is a code owner

@FFY00FFY00Awaiting requested review from FFY00FFY00 is a code owner

@hugovkhugovkAwaiting requested review from hugovkhugovk is a code owner

@1st11st1Awaiting requested review from 1st11st1 is a code owner

Assignees
No one assigned
Labels
Projects
Status: Todo
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

8 participants
@vstinner@zooba@efimov-mikhail@philthompson10@ncoghlan@AA-Turner@terryjreedy@ZeroIntensity

[8]ページ先頭

©2009-2025 Movatter.jp