Skip to content

The index directive with "builtin" type generates different index entry than the function directive #7219

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 Feb 26, 2020 · 3 comments

Comments

@serhiy-storchaka
Copy link

.. index::
   builtin: max

and

.. function:: max(iterable, *[, key, default])

generate similar but different index entries.

The former generates:

max
    built-in function

The latter generates:

max() (built-in function)

Differences:

  1. Parenthesis are added or not after the name of the function.
  2. Parenthesis are added or not around "built-in function".
  3. It takes one or two lines.
  4. "max" is a link or not.

Link: https://docs.python.org/3/genindex-M.html

This issue was reported on the Python bug tracker: https://bugs.python.org/issue21352.

Would be nice to unify and merge index entries generated by "function" and "index".

@tk0miya
Copy link
Member

tk0miya commented Feb 29, 2020

Unfortunately, python specific index types (like builtin) were deprecated in 10 years ago: 3e9182550a#diff-238bd7cedf25808f7e89537fbcd798dcR188-R189
And we are considering to remove it in future: #6970 . But we need to consider about it more deeply...

@serhiy-storchaka
Copy link
Author

What should be used in the Python documentation?

@tk0miya
Copy link
Member

tk0miya commented Mar 28, 2020

Now the deprecation of python specific index types is postponed (see #6970). So I just made a fix for this #7395.

@tk0miya tk0miya added this to the 3.0.0 milestone Mar 28, 2020
tk0miya added a commit to tk0miya/sphinx that referenced this issue Mar 29, 2020
tk0miya added a commit that referenced this issue Mar 29, 2020
Fix #7219: py:function directive generates incorrect index entry
@tk0miya tk0miya closed this as completed Mar 29, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants