Skip to content

Datamodel: Add headings to the standard type hierarchy #108146

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

Merged
merged 11 commits into from
Aug 25, 2023

Conversation

AA-Turner
Copy link
Member

@AA-Turner AA-Turner commented Aug 19, 2023

I was looking to resolve reference warnings in the datamodel documentation, and noticed that the entire The standard type hierarchy section is comprised of definition lists. This makes it fairly hard to navigate via the sidebar, with three levels of nested indentation.

Each commit in this PR is a discrete step:

  • Add sub-headings
  • Remove level one indentation
  • Add sub-sub-headings
  • Remove level two indentation
  • Add sub-sub-sub-headings
  • Remove level three indentation
  • Move two notes that were after their sub-sub-sub-sections to the relevant sub-sub-section
  • Reword the two aforementioned notes

This is a preparatory PR for future improvements, but I think one that stands alone as an improvement to navigation. I imagine backports will need to be done manually due to changes in the datamodel between 3.11-3.13, happy to handle them.

A


📚 Documentation preview 📚: https://cpython-previews--108146.org.readthedocs.build/en/108146/reference/datamodel.html

@AA-Turner AA-Turner added docs Documentation in the Doc dir skip issue skip news needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Aug 19, 2023
@erlend-aasland
Copy link
Contributor

erlend-aasland commented Aug 21, 2023

I wonder if it would make sense to keep the definition lists for the innermost (sub-sub-sub) sections (that is, revert commit b6f31b9 and 3b3f580).

@AA-Turner
Copy link
Member Author

Fine by me!

@erlend-aasland
Copy link
Contributor

Hm, it looks like the two intrinsic set types should also be a definition list. Also, I find it strange that "Notes on using __slots__" is a sub-sub-sub-section. Would it not fit better as a bullet list in the parent sub-sub-section?

@AA-Turner
Copy link
Member Author

AA-Turner commented Aug 24, 2023

Hm, it looks like the two intrinsic set types should also be a definition list.

No strong opinion here, so made them definition lists.

Also, I find it strange that "Notes on using slots" is a sub-sub-sub-section. Would it not fit better as a bullet list in the parent sub-sub-section?

A sub-sub-sub-sub-section, even! I'll open a new PR for Notes on using slots, this one is only intended to look at section 3.2 (the standard type hierarchy). Update: see #108400.

A

@erlend-aasland
Copy link
Contributor

@hugovk, are you ok with this change?

Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

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

Fine by me, no strong opinion, but more linkable things in long pages is helpful. Thanks!

@hugovk
Copy link
Member

hugovk commented Aug 25, 2023

One little unrelated suggestion we could lump in here, we could add some formatting to "(type[, value[, traceback]])" at the end of:

image

But not essential!

@erlend-aasland
Copy link
Contributor

One little unrelated suggestion we could lump in here, we could add some formatting to "(type[, value[, traceback]])" at the end of [...]

I'd prefer this PR to only restructure the file but keep the content unchanged :)

@erlend-aasland erlend-aasland merged commit 2b7bff0 into python:main Aug 25, 2023
@miss-islington
Copy link
Contributor

Thanks @AA-Turner for the PR, and @erlend-aasland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

@miss-islington
Copy link
Contributor

Sorry, @AA-Turner and @erlend-aasland, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 2b7bff0655a4caf51cd1a9e5bf85b3b96dd031c9 3.11

@bedevere-bot
Copy link

GH-108477 is a backport of this pull request to the 3.12 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.12 only security fixes label Aug 25, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 25, 2023
Dedent content according to the new layout.
(cherry picked from commit 2b7bff0)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
@erlend-aasland erlend-aasland added needs backport to 3.11 only security fixes and removed needs backport to 3.11 only security fixes labels Aug 25, 2023
@miss-islington
Copy link
Contributor

Thanks @AA-Turner for the PR, and @erlend-aasland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry @AA-Turner and @erlend-aasland, I had trouble checking out the 3.11 backport branch.
Please retry by removing and re-adding the "needs backport to 3.11" label.
Alternatively, you can backport using cherry_picker on the command line.
cherry_picker 2b7bff0655a4caf51cd1a9e5bf85b3b96dd031c9 3.11

@hugovk hugovk added needs backport to 3.11 only security fixes and removed needs backport to 3.11 only security fixes labels Aug 25, 2023
@miss-islington
Copy link
Contributor

Thanks @AA-Turner for the PR, and @erlend-aasland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry @AA-Turner and @erlend-aasland, I had trouble checking out the 3.11 backport branch.
Please retry by removing and re-adding the "needs backport to 3.11" label.
Alternatively, you can backport using cherry_picker on the command line.
cherry_picker 2b7bff0655a4caf51cd1a9e5bf85b3b96dd031c9 3.11

AA-Turner added a commit to AA-Turner/cpython that referenced this pull request Aug 25, 2023
…GH-108146)

Dedent content according to the new layout..
(cherry picked from commit 2b7bff0)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
@bedevere-bot
Copy link

GH-108484 is a backport of this pull request to the 3.11 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Aug 25, 2023
hugovk pushed a commit that referenced this pull request Aug 25, 2023
) (#108484)

* [3.11] Datamodel: Add headings to the standard type hierarchy (GH-108146)

Dedent content according to the new layout..
(cherry picked from commit 2b7bff0)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>

* Fix indentation
Yhg1s pushed a commit that referenced this pull request Aug 25, 2023
) (#108477)

Datamodel: Add headings to the standard type hierarchy (GH-108146)

Dedent content according to the new layout.
(cherry picked from commit 2b7bff0)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
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
None yet
Development

Successfully merging this pull request may close these issues.

5 participants