Skip to content
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

GH-115986 Fix pprint documentation #116019

Merged
merged 10 commits into from Feb 28, 2024

Conversation

Privat33r-dev
Copy link
Contributor

@Privat33r-dev Privat33r-dev commented Feb 28, 2024

I decided to separate the solution in 2 PRs. One PR is for fixing positions, references and including information that pprint.pprint function is unintuitive. And the other one would include setting up pp as default.

At first I thought that message about pprint.pprint being unintuitive might be divisive/hard to write, but later I figured out that it's a small change and fits current PR. Examples with pprint.pp might be divisive though, so once this PR is accepted, another PR is going to be introduced with the change.


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

@Privat33r-dev
Copy link
Contributor Author

Sorry for assignments, git acted a bit funny, likely due to the fact the I pulled locally, but haven't updated repo on github, so it decided to include some other changes as part of the PR. Looks like it was resolved.

Ensure `pp` and `pprint` are positioned prominently at the top of the page.
Before links pointed out to the module `pprint` instead of the `pprint.pprint` function.
@hugovk
Copy link
Member

hugovk commented Feb 28, 2024

Please don't force-push PRs, it can make things harder to review, and everything will be squash-merged at the end. Thanks!

https://devguide.python.org/getting-started/pull-request-lifecycle/

As `pprint` might have unintended consequences with dict sorting.
@Privat33r-dev
Copy link
Contributor Author

Please don't force-push PRs, it can make things harder to review, and everything will be squash-merged at the end. Thanks!

https://devguide.python.org/getting-started/pull-request-lifecycle/

Thanks for the advice. Earlier I worked on projects with different workflow where rebase was a standard procedure.

@erlend-aasland
Copy link
Contributor

I decided to separate the solution in 2 PRs [...]

Thanks; it is better to do multiple PRs of atomic changes, than one giant PR with lots of changes. This holds both for code and docs changes.

Doc/library/pprint.rst Outdated Show resolved Hide resolved
Doc/library/pprint.rst Outdated Show resolved Hide resolved
Doc/library/pprint.rst Outdated Show resolved Hide resolved
@erlend-aasland
Copy link
Contributor

erlend-aasland commented Feb 28, 2024

One more thing: please do not mention GitHub accounts in commit messages (such as 6f4cf93); they turn up as notifications and thus end up as noise.

@Privat33r-dev
Copy link
Contributor Author

One more thing: please do not mention GitHub accounts in commit messages (such as 6f4cf93); they turn up as notifications and thus end up as noise.

Should I rebase now or is it just for the future?

@erlend-aasland
Copy link
Contributor

Should I rebase now or is it just for the future?

For the future. Also, do a git merge --no-ff main -m "Pull in main" instead of rebasing.

erlend-aasland
erlend-aasland previously approved these changes Feb 28, 2024
Copy link
Contributor

@erlend-aasland erlend-aasland left a comment

Choose a reason for hiding this comment

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

LGTM; thanks!

@erlend-aasland erlend-aasland added needs backport to 3.11 only security fixes needs backport to 3.12 bug and security fixes labels Feb 28, 2024
@erlend-aasland erlend-aasland merged commit 6c1c94d into python:main Feb 28, 2024
26 checks passed
@miss-islington-app

This comment was marked as outdated.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 28, 2024
…GH-116019)

Introduce a new subsubsection, 'Functions', for module level functions,
and place it before the PrettyPrinter class reference.

Also:
- Fix pprint.pprint() references so they properly link to the module
  level function.
- Add links to sys.stdout.
(cherry picked from commit 6c1c94d)

Co-authored-by: Kerim Kabirov <39376984+Privat33r-dev@users.noreply.github.com>
@miss-islington-app

This comment was marked as outdated.

@bedevere-app
Copy link

bedevere-app bot commented Feb 28, 2024

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

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Feb 28, 2024
@bedevere-app
Copy link

bedevere-app bot commented Feb 28, 2024

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

@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Feb 28, 2024
erlend-aasland pushed a commit that referenced this pull request Feb 28, 2024
…6019) (#116061)

GH-115986 Reorder pprint docs and amend some references (GH-116019)

Introduce a new subsubsection, 'Functions', for module level functions,
and place it before the PrettyPrinter class reference.

Also:
- Fix pprint.pprint() references so they properly link to the module
  level function.
- Add links to sys.stdout.
(cherry picked from commit 6c1c94d)

Co-authored-by: Kerim Kabirov <39376984+Privat33r-dev@users.noreply.github.com>
erlend-aasland added a commit that referenced this pull request Feb 28, 2024
…) (#116064)

(cherry picked from commit 6c1c94d)

Introduce a new subsubsection, 'Functions', for module level functions,
and place it before the PrettyPrinter class reference.

Also:
- Fix pprint.pprint() references so they properly link to the module
  level function.
- Add links to sys.stdout.

Co-authored-by: Kerim Kabirov <39376984+Privat33r-dev@users.noreply.github.com>
@Privat33r-dev Privat33r-dev deleted the fix-docs-115986 branch February 29, 2024 09:02
woodruffw pushed a commit to woodruffw-forks/cpython that referenced this pull request Mar 4, 2024
…#116019)

Introduce a new subsubsection, 'Functions', for module level functions,                                   
and place it before the PrettyPrinter class reference.                                                    
                                                                                                          
Also:
- Fix pprint.pprint() references so they properly link to the module                                   
  level function.
- Add links to sys.stdout.
erlend-aasland pushed a commit that referenced this pull request Mar 5, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 5, 2024
Amend wording after pythongh-116019 was merged.
(cherry picked from commit e205c5c)

Co-authored-by: Kerim Kabirov <39376984+Privat33r-dev@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 5, 2024
Amend wording after pythongh-116019 was merged.
(cherry picked from commit e205c5c)

Co-authored-by: Kerim Kabirov <39376984+Privat33r-dev@users.noreply.github.com>
erlend-aasland pushed a commit that referenced this pull request Mar 5, 2024
Amend wording after gh-116019 was merged.
(cherry picked from commit e205c5c)

Co-authored-by: Kerim Kabirov <39376984+Privat33r-dev@users.noreply.github.com>
erlend-aasland pushed a commit that referenced this pull request Mar 5, 2024
Amend wording after gh-116019 was merged.
(cherry picked from commit e205c5c)

Co-authored-by: Kerim Kabirov <39376984+Privat33r-dev@users.noreply.github.com>
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 25, 2024
…#116019)

Introduce a new subsubsection, 'Functions', for module level functions,                                   
and place it before the PrettyPrinter class reference.                                                    
                                                                                                          
Also:
- Fix pprint.pprint() references so they properly link to the module                                   
  level function.
- Add links to sys.stdout.
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 25, 2024
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
…#116019)

Introduce a new subsubsection, 'Functions', for module level functions,                                   
and place it before the PrettyPrinter class reference.                                                    
                                                                                                          
Also:
- Fix pprint.pprint() references so they properly link to the module                                   
  level function.
- Add links to sys.stdout.
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
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 news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants