Skip to content

gh-134946 docs: fix formatting in dataclasses.rst #134948

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

Conversation

alesolda
Copy link

@alesolda alesolda commented May 30, 2025

Correct boolean literals by replacing 'true' with 'True' for accuracy and consistency.

Fixes gh-134946


📚 Documentation preview 📚: https://cpython-previews--134948.org.readthedocs.build/

@alesolda alesolda requested a review from ericvsmith as a code owner May 30, 2025 18:20
@python-cla-bot
Copy link

python-cla-bot bot commented May 30, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app bedevere-app bot added awaiting review docs Documentation in the Doc dir skip news labels May 30, 2025
@github-project-automation github-project-automation bot moved this to Todo in Docs PRs May 30, 2025
@alesolda alesolda changed the title Docs: fix formatting in dataclasses.rst gh-134946 docs: fix formatting in dataclasses.rst May 30, 2025
@alesolda alesolda force-pushed the gh-134946-doc-fix-format-dataclasses branch from 9eb96a7 to 7f75826 Compare May 30, 2025 18:31
@alesolda alesolda marked this pull request as draft May 30, 2025 18:36
@alesolda alesolda force-pushed the gh-134946-doc-fix-format-dataclasses branch 4 times, most recently from 45ec776 to 2d59921 Compare May 30, 2025 22:12
Correct boolean literals by replacing 'true' with '``True``' for accuracy and consistency.

Resolves pythongh-134946
@alesolda alesolda force-pushed the gh-134946-doc-fix-format-dataclasses branch from 2d59921 to 060dd93 Compare May 30, 2025 22:17
@alesolda alesolda marked this pull request as ready for review May 30, 2025 22:30
@Yzi-Li
Copy link
Contributor

Yzi-Li commented May 31, 2025

There are similar cases on lines 117, 154 and 155. Would you mind fixing them too?

@ericvsmith ericvsmith self-assigned this May 31, 2025
@ericvsmith
Copy link
Member

The original intent was to differentiate between True (the singular value) and something that's "truthy" (that is, it evaluates to True in a boolean context. I'd like to avoid "If true (the default is True)", but I suppose it's more correct.

All of the ones that were changed to "If True (the default is False)" should instead be left alone. "If true (the default is False)" is correct.

@alesolda
Copy link
Author

Hi @ericvsmith 👋 , thanks for the clarification.

if I understood correctly, then there is only one occurrence to be changed:

unsafe_hash: If False (the default)
to
unsafe_hash: If false (the default)

Is this correct?

@Yzi-Li
Copy link
Contributor

Yzi-Li commented Jun 1, 2025

unsafe_hash: If False (the default)

I think the correct change is: if false (the default is False). The default value of unsafe_hash is boolean False. "false" means something that evaluates to False in a boolean context.

@Viicos
Copy link
Contributor

Viicos commented Jun 1, 2025

Note: I already have an open PR for this: #116532 (although not taking the same approach).

@ericvsmith
Copy link
Member

ericvsmith commented Jun 1, 2025

Maybe they should all be rewritten so that they describe the behavior if the flag is set, not ever if the flag has a "falsy" value. Then at the end, put the default value. So they'd all become something like "If true, then <whatever>. The default value is True". Or "If true, then <whatever>. The default value is False." Or maybe omit the default values entirely, they're given immediately above.

At this point I suggest someone from the documentation group take a look, or just leave it as it is.

@AA-Turner
Copy link
Member

I don't this PR adds anything, would suggest closing.

A

@AA-Turner AA-Turner added the pending The issue will be closed if no feedback is provided label Jun 2, 2025
@alesolda alesolda closed this Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review docs Documentation in the Doc dir pending The issue will be closed if no feedback is provided skip news
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

Inconsistent format in dataclasses.rst
6 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy