Issue 24314: irrelevant cross-link in documentation of user-defined functions (original) (raw)

Issue24314

Created on 2015-05-28 14:27 by july, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
special-attr.patch martin.panter,2015-05-29 04:12 review
Messages (4)
msg244301 - (view) Author: July Tikhonov (july) * Date: 2015-05-28 14:27
https://docs.python.org/3/reference/datamodel.html#the-standard-type-hierarchy There is a table of "special attributes" of user-defined functions. The __name__ attribute name is a link, but it leads to something quite irrelevant: the description of __name__ attribute of imported modules. In Doc/reference/datamodel.rst, there is nothing special about __name__ attribute, so it looks like some random spasm of Sphinx creating links here and there. My knowledge of rst is not sufficient to suppress it.
msg244358 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-05-29 04:12
I think the proper way to suppress the link is :attr:`!__name__`. However I am posting a patch which takes a different approach. I tweaked some of the entries under <https://docs.python.org/dev/library/stdtypes.html#special-attributes> that also apply to functions, etc. I invented the pseudo class name “definition” for this; better suggestions are welcome! Then I converted the user-defined functions reference, as well as many other references, to :attr:`~definition.__name__` or similar, for these three attributes: * definition.__name__ * definition.__qualname__ * object.__dict__ I also moved the index markup so that the index entries for the table of function attributes work.
msg268776 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-06-18 08:23
New changeset 1ed4e4a168bb by Martin Panter in branch '2.7': Issue #24314: Add links for general attributes like __name__, __dict__ https://hg.python.org/cpython/rev/1ed4e4a168bb New changeset 4c361e189747 by Martin Panter in branch '3.5': Issue #24314: Fix doc links for general attributes like __name__, __dict__ https://hg.python.org/cpython/rev/4c361e189747 New changeset 79a3aff60e37 by Martin Panter in branch 'default': Issue #24314: Merge doc links from 3.5 https://hg.python.org/cpython/rev/79a3aff60e37
msg268778 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-06-18 09:04
I also backported most of my changes to 2.7, although __name__ wasn’t originally linking to anything at all there.
History
Date User Action Args
2022-04-11 14:58:17 admin set github: 68502
2016-06-18 09:04:44 martin.panter set status: open -> closedversions: - Python 3.4messages: + resolution: fixedstage: patch review -> resolved
2016-06-18 08:23:15 python-dev set nosy: + python-devmessages: +
2015-05-29 04:12:12 martin.panter set files: + special-attr.patchnosy: + martin.pantermessages: + keywords: + patchstage: patch review
2015-05-28 14:27:14 july create