Skip to content

Add missing cross-references to improve navigation in getpass.rst#151092

Merged
nedbat merged 5 commits into
python:mainfrom
sergiolpzgmz:add-missing-cross-references-in-getpass
Jun 9, 2026
Merged

Add missing cross-references to improve navigation in getpass.rst#151092
nedbat merged 5 commits into
python:mainfrom
sergiolpzgmz:add-missing-cross-references-in-getpass

Conversation

@sergiolpzgmz

Copy link
Copy Markdown
Contributor

No description provided.

@sergiolpzgmz sergiolpzgmz force-pushed the add-missing-cross-references-in-getpass branch from 34dc965 to c5d4779 Compare June 8, 2026 16:11
@read-the-docs-community

read-the-docs-community Bot commented Jun 8, 2026

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33060661 | 📁 Comparing 911ddd2 against main (11a8bdf)

  🔍 Preview build  

5 files changed · ± 5 modified

± Modified

Comment thread Doc/library/getpass.rst Outdated

If echo free input is unavailable getpass() falls back to printing
a warning message to *stream* and reading from ``sys.stdin`` and
If echo free input is unavailable :meth:`~getpass.getpass` falls back to printing

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We don't want to link to a function in its documentation, see the style guide for more information on links. However, you also found a linklint bug (or workaround)!

CC @nedbat for the bug.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

:meth: is tested, and works. It looks like the problem here with linklint is getpass.getpass vs getpass. In this line, I tried all combinations (using ' here instead of `):
:meth:'getpass' is linked.
:meth:'getpass.getpass' is linked
:meth:'~getpass.getpass' is linked
:func:'getpass' is NOT linked.
:func:'getpass.getpass' is linked
:func:'~getpass.getpass' is linked
So to remain unlinked, the type has to match (func), and the name can't be fully qualified. I thought linklint was better about that....

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We don't want to link to a function in its documentation, see the style guide for more information on links. However, you also found a linklint bug (or workaround)!

I see the point. I interpreted the guidance too broadly and ended up applying a link where it wasn’t really adding value in context. I’ll revise the change to better align with the intended usage

@StanFromIreland StanFromIreland mentioned this pull request Jun 8, 2026
Comment thread Doc/library/getpass.rst Outdated

If echo free input is unavailable getpass() falls back to printing
a warning message to *stream* and reading from ``sys.stdin`` and
If echo free input is unavailable :meth:`~getpass.getpass` falls back to printing

@nedbat nedbat Jun 8, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

While we are here:

Suggested change
If echo free input is unavailable :meth:`~getpass.getpass` falls back to printing
If echo-free input is unavailable :func:`getpass` falls back to printing

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review, I'll keep that in mind.

Comment thread Doc/library/getpass.rst Outdated

.. note::
If you call getpass from within IDLE, the input may be done in the
If you call :meth:`~getpass.getpass` from within IDLE, the input may be done in the

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
If you call :meth:`~getpass.getpass` from within IDLE, the input may be done in the
If you call :func:`getpass` from within IDLE, the input may be done in the

@nedbat

nedbat commented Jun 9, 2026

Copy link
Copy Markdown
Member

Linklint 1.0.1 will properly resolve and unlink these references.

@nedbat nedbat merged commit 3266ede into python:main Jun 9, 2026
30 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Jun 9, 2026
@sergiolpzgmz

Copy link
Copy Markdown
Contributor Author

Thanks for the reviews!

@sergiolpzgmz sergiolpzgmz deleted the add-missing-cross-references-in-getpass branch June 9, 2026 18:29
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 issue skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants