Skip to content

Conversation

@wjandrea
Copy link
Contributor

@wjandrea wjandrea commented Sep 3, 2025

Comma should be a colon, as written at the same spot under fwalk.


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

Specifically: https://cpython-previews--138466.org.readthedocs.build/en/138466/library/os.html#os.walk

Comma should be a colon, as written at the same spot under `fwalk`.
@bedevere-app bedevere-app bot added docs Documentation in the Doc dir skip news labels Sep 3, 2025
@github-project-automation github-project-automation bot moved this to Todo in Docs PRs Sep 3, 2025
@StanFromIreland StanFromIreland added skip issue pending The issue will be closed if no feedback is provided labels Sep 3, 2025
@StanFromIreland
Copy link
Member

I don’t see any particular benefit, it seems like a cosmetic change to me.

@wjandrea
Copy link
Contributor Author

wjandrea commented Sep 3, 2025

I don’t see any particular benefit, it seems like a cosmetic change to me.

How not? There's a comma splice. Replacing the comma with a colon fixes the grammatical error.

@wjandrea wjandrea marked this pull request as ready for review September 3, 2025 17:40

In the next example (simple implementation of :func:`shutil.rmtree`),
walking the tree bottom-up is essential, :func:`rmdir` doesn't allow
walking the tree bottom-up is essential: :func:`rmdir` doesn't allow
Copy link
Member

Choose a reason for hiding this comment

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

?

Suggested change
walking the tree bottom-up is essential: :func:`rmdir` doesn't allow
walking the tree bottom-up is essential, because :func:`rmdir` doesn't allow

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, that's also a good suggestion, but fwalk already uses a colon:

cpython/Doc/library/os.rst

Lines 3767 to 3768 in 424e2ab

In the next example, walking the tree bottom-up is essential:
:func:`rmdir` doesn't allow deleting a directory before the directory is

So I used the same for consistency. No need to edit two spots when one will do, but if you think it would be clearer to add "because", by all means.

Another option is:

walking the tree bottom-up is essential since :func:`rmdir` doesn't allow

Copy link
Member

Choose a reason for hiding this comment

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

We could also use a semicolon, but I like this more.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ZeroIntensity Yeah, a semicolon would fix the grammar, but using a colon does the same and implies "because".

Copy link
Member

Choose a reason for hiding this comment

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

Excess brevity is not called for here, I think 'because' is fine. Given it's immediately before a role that also starts with :, having the colon could be a little confusing.

Copy link
Member

Choose a reason for hiding this comment

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

No need to edit two spots when one will do, but if you think it would be clearer to add "because", by all means.

It's fine to have inconsistent styles -- English doesn't follow PEP 8 :)

@ZeroIntensity ZeroIntensity removed the pending The issue will be closed if no feedback is provided label Sep 3, 2025
@ZeroIntensity
Copy link
Member

I've removed pending because this is indeed a grammar error.

@StanFromIreland
Copy link
Member

Please do not use the Update Branch button unless necessary (e.g. fixing conflicts, jogging the CI, or very old PRs) as it uses valuable resources. For more information see the devguide.

@wjandrea
Copy link
Contributor Author

wjandrea commented Sep 3, 2025

@StanFromIreland Yeah, sorry, I'm so used to clicking it mindlessly for something else I'm working on then realized it was totally unnecessary here.

@AA-Turner AA-Turner changed the title DOC: Typo in os.rst Doc: Improve grammar in os.walk example Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

4 participants