Skip to content

gh-87904: Document curses classes#151643

Merged
serhiy-storchaka merged 3 commits into
python:mainfrom
serhiy-storchaka:curses-docs3
Jun 24, 2026
Merged

gh-87904: Document curses classes#151643
serhiy-storchaka merged 3 commits into
python:mainfrom
serhiy-storchaka:curses-docs3

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jun 18, 2026

Copy link
Copy Markdown
Member

Add docstrings for the curses.window, curses.error, curses.panel.panel and curses.panel.error classes. Document the panel class and its error exception in curses.panel.rst, using the real lowercase panel name.

Add docstrings for the curses.window, curses.error, curses.panel.panel
and curses.panel.error classes.  Document the panel class and its error
exception in curses.panel.rst, using the real lowercase panel name.
@serhiy-storchaka serhiy-storchaka added needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Jun 18, 2026
@serhiy-storchaka serhiy-storchaka requested a review from hugovk June 18, 2026 11:06
@read-the-docs-community

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

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33283298 | 📁 Comparing 09821e0 against main (12add38)

  🔍 Preview build  

29 files changed · ± 29 modified

± Modified

@serhiy-storchaka

Copy link
Copy Markdown
Member Author

@encukou, are these IDs case-sensitive?

Comment thread Doc/tools/removed-ids.txt Outdated
c-api/typeobj.html: c.Py_tp_bases

# curses.panel.panel is the correct class name.
library/curses.panel.html: curses.panel.Panel.above

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.

I think it would be better to preserve them, like we do elsewhere by injecting some anchors:

.. raw:: html

   <!-- Keep the old URL fragments working (see gh-89554) -->
   <span id='thread.lock.acquire'></span>
   <span id='thread.lock.release'></span>
   <span id='thread.lock.locked'></span>

@encukou

encukou commented Jun 19, 2026

Copy link
Copy Markdown
Member

are these IDs case-sensitive?

Yes. (see: nOTES vs Notes)

I think it would be better to preserve them

That can be a separate (docs-wide) decision; this PR can just add these to removed-ids.txt.

@serhiy-storchaka

Copy link
Copy Markdown
Member Author

Alternative solution -- rename curses.panel.panel to curses.panel.Panel. But then we would perhaps need to also rename curses.window to curses.Window, and this will create much more IDs issues.

@serhiy-storchaka

Copy link
Copy Markdown
Member Author

I think it is better to resolve such issues on the HTML server side, if possible. Or add a special Sphynx extension.

This PR is needed for #151748.

@StanFromIreland

Copy link
Copy Markdown
Member

I think it is better to resolve such issues on the HTML server side, if possible. Or add a special Sphynx extension.

Server redirects can be added to https://github.com/python/psf-salt/blob/main/salt/docs/config/nginx.docs-redirects.conf. Hugo proposed a Sphinx extension above, it "redirects" by creating files at the locations pointing to the new location.

@hugovk

hugovk commented Jun 23, 2026

Copy link
Copy Markdown
Member

Hugo proposed a Sphinx extension above, it "redirects" by creating files at the locations pointing to the new location.

Here: #151656 (comment)

A benefit of using the Sphinx extension is that each branch is self-contained, so also works locally and for third parties (who of course aren't hosting on PSF infra).

Instead of excluding the renamed curses.panel.Panel.* IDs from the
check-html-ids.py check, keep the old URL fragments working by injecting
<span> anchors, as proposed by Stan Ulbrych and done elsewhere (pythongh-89554).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@serhiy-storchaka

Copy link
Copy Markdown
Member Author

In this case, redirection cannot help, we need to add anchors. The question is only whether to add a raw html, invisible no-typesetting declarations, or use custom Sphinx directives from extension. For now, I added a raw html.

@serhiy-storchaka serhiy-storchaka enabled auto-merge (squash) June 24, 2026 05:46
@serhiy-storchaka serhiy-storchaka merged commit 560ff8e into python:main Jun 24, 2026
54 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.14 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 560ff8e2021d818555884622f6865f4a0d60756f 3.14

@bedevere-app

bedevere-app Bot commented Jun 24, 2026

Copy link
Copy Markdown

GH-152048 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jun 24, 2026
@serhiy-storchaka serhiy-storchaka deleted the curses-docs3 branch June 24, 2026 07:18
serhiy-storchaka added a commit that referenced this pull request Jun 24, 2026
Add docstrings for the curses.window, curses.error, curses.panel.panel
and curses.panel.error classes.  Document the panel class and its error
exception in curses.panel.rst, using the real lowercase panel name.
(cherry picked from commit 560ff8e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants