Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Use proper markup for the C "constants" #106919

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
serhiy-storchaka opened this issue Jul 20, 2023 · 1 comment
Closed

Use proper markup for the C "constants" #106919

serhiy-storchaka opened this issue Jul 20, 2023 · 1 comment
Labels
docs Documentation in the Doc dir topic-C-API

Comments

@serhiy-storchaka
Copy link
Member

serhiy-storchaka commented Jul 20, 2023

Many of the C "constants" (actually macros without parameters) are declared in the documentation using the data directive and referred using :data: and :const: roles. It is incorrect, because these directive and roles are defined in the Python domain and purposed to use with Python module level variables. I think that it is better to document them as they are, the C macros.

One of the differences is that the HTML anchors contains the c. prefix, e.g. c.METH_VARARGS. There may also be the difference in visual representation.

Other issues in the current markup:

  • In the index they are marked as "(built-in variable)".
  • There are no index entries for METH_KEYWORDS and METH_METHOD and they cannot be referred.
  • There are two definitions of Py_TPFLAGS_HAVE_GC. They does not conflict only because they are in different namespaces.

Linked PRs

@serhiy-storchaka serhiy-storchaka added docs Documentation in the Doc dir topic-C-API labels Jul 20, 2023
@serhiy-storchaka serhiy-storchaka changed the title Use proper narjup for the C "constants" Use proper markup for the C "constants" Jul 20, 2023
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Jul 20, 2023
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Jul 21, 2023
…stants" (pythonGH-106920).

(cherry picked from commit fcc816d)

Co-authored-by: Serhiy Storchaka <[email protected]>
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Jul 21, 2023
…stants" (pythonGH-106920).

(cherry picked from commit fcc816d)

Co-authored-by: Serhiy Storchaka <[email protected]>
@encukou
Copy link
Member

encukou commented Aug 2, 2023

Are you aware of the discussion in #96996?

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 topic-C-API
Projects
None yet
Development

No branches or pull requests

2 participants