Skip to content

Conversation

@Yashp002
Copy link
Contributor

@Yashp002 Yashp002 commented Nov 20, 2025

This PR adds C API documentation for six previously undocumented type objects:

In Doc/c-api/descriptor.rst:

  • PyClassMethodDescr_Type - type for class method descriptors
  • PyGetSetDescr_Type - type for get/set descriptors
  • PyMemberDescr_Type - type for member descriptors
  • PyMethodDescr_Type - type for method descriptors
  • PyWrapperDescr_Type - type for wrapper descriptors

In Doc/c-api/dict.rst:

  • PyDictProxy_Type - type for mapping proxy objects

Each entry follows the existing documentation style and includes a brief description of the type's purpose and its relationship to the Python layer.

Contributes to #141004.


📚 Documentation preview 📚: https://cpython-previews--141803.org.readthedocs.build/

@ZeroIntensity ZeroIntensity self-requested a review November 21, 2025 12:12
@Yashp002
Copy link
Contributor Author

Hi @ZeroIntensity, thanks for the review and apologies for the delay. I've addressed all the feedback:

  • Linked descriptor docs to their corresponding types.*DescriptorType classes (MemberDescriptorType, MethodDescriptorType, WrapperDescriptorType)
  • Moved PyGetSetDescr_Type out of the "Built-in descriptors" section to the correct location with the other C API type objects
  • Added a reference to types.MappingProxyType for PyDictProxy_Type

All checks are passing. Please let me know if anything else needs adjustment.

Copy link
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

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

Looks pretty good, a few final comments.

Comment on lines 28 to 29
C struct as attributes on a type, and correspond to :class:`types.MemberDescriptorType`
objects in the Python layer.
Copy link
Member

Choose a reason for hiding this comment

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

We try to keep lines below 80 characters, but this line exceeds that limit. Same goes for a few lines below.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

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

LGTM as well, thanks!

@ZeroIntensity ZeroIntensity enabled auto-merge (squash) December 1, 2025 15:46
@ZeroIntensity ZeroIntensity added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Dec 1, 2025
@ZeroIntensity ZeroIntensity merged commit 52f9b5f into python:main Dec 1, 2025
32 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Docs PRs Dec 1, 2025
@miss-islington-app
Copy link

Thanks @Yashp002 for the PR, and @ZeroIntensity for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 1, 2025
…honGH-141803)

(cherry picked from commit 52f9b5f)

Co-authored-by: Yashraj <[email protected]>
Co-authored-by: Peter Bierma <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 1, 2025
…honGH-141803)

(cherry picked from commit 52f9b5f)

Co-authored-by: Yashraj <[email protected]>
Co-authored-by: Peter Bierma <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Dec 1, 2025

GH-142147 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Dec 1, 2025
@bedevere-app
Copy link

bedevere-app bot commented Dec 1, 2025

GH-142148 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Dec 1, 2025
ZeroIntensity added a commit that referenced this pull request Dec 1, 2025
…-141803) (GH142147)

gh-141004: Document descriptor and dict proxy type objects (GH-141803)
(cherry picked from commit 52f9b5f)

Co-authored-by: Yashraj <[email protected]>
Co-authored-by: Peter Bierma <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
ZeroIntensity added a commit that referenced this pull request Dec 1, 2025
…-141803) (GH-142148)

gh-141004: Document descriptor and dict proxy type objects (GH-141803)
(cherry picked from commit 52f9b5f)

Co-authored-by: Yashraj <[email protected]>
Co-authored-by: Peter Bierma <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
@Yashp002
Copy link
Contributor Author

Yashp002 commented Dec 2, 2025

Thanks @ZeroIntensity for the guidance :)

StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull request Dec 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants