GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-30670: Add pp function to the pprint module by remilapeyre · Pull Request #11769 · python/cpython

Conversation

@remilapeyre

@remilapeyre remilapeyre commented Feb 6, 2019 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Add sort_dicts to pprint.PrettyPrinter, pprint.pformat and pprint.pprint

https://bugs.python.org/issue30670

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Rémi Lapeyre
Add pp function to the pprint module
30152b8
Add sort_dicts to pprint.PrettyPrinter, pprint.pformat and pprint.pprint
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Feb 6, 2019
@bedevere-bot bedevere-bot added the awaiting review label Feb 6, 2019
Rémi Lapeyre added 2 commits February 6, 2019 12:16
Rémi Lapeyre
Run make patchcheck
c75298b
Rémi Lapeyre
Fix blurb
e7242c0
eamanu
eamanu reviewed Feb 6, 2019
View reviewed changes
Comment thread Doc/library/pprint.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/pprint.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Rémi Lapeyre
Fix changes order in documentation
52f6ed3
eamanu
eamanu reviewed Feb 6, 2019
View reviewed changes
Comment thread Doc/library/pprint.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

eamanu
eamanu approved these changes Feb 6, 2019
View reviewed changes

@eamanu eamanu left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I test the behavior (ubuntu 18.04) and this PR accomplish with the bpo. IMO, after solve the Travis CI error this should be ready for merge. Before be review by a core dev :-)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-bot bedevere-bot added awaiting core review and removed awaiting review labels Feb 6, 2019
Rémi Lapeyre added 3 commits February 6, 2019 14:44
Rémi Lapeyre
Fix inline reference in documentation
9a7aaed
Rémi Lapeyre
Fix order of change notes in documentation
bb2c055
Rémi Lapeyre
Fix sphinx suspicious check
765a9f9
eamanu
eamanu reviewed Feb 7, 2019
View reviewed changes
Comment thread Doc/tools/susp-ignored.csv Resolved

Uh oh!

There was an error while loading. Please reload this page.

ewjoachim
ewjoachim approved these changes Feb 8, 2019
View reviewed changes
Comment thread Doc/library/pprint.rst
Added the *sort_dicts* parameter.


.. function:: pp(object, *args, sort_dicts=False, **kwargs)

@ewjoachim ewjoachim Feb 8, 2019

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Would it be worth explicitely saying that this is an alias of pprint() with sort_dict=False ?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@remilapeyre remilapeyre Feb 8, 2019

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

There is already a mention of *args and **kwargs being passed to pprint and sort_dicts=False is in the signature of pp so I don't think it is necessary.

I would like to also like to avoid giving to much details about pp implementation because we may change some things if another data structure of Python changes like dicts did.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ewjoachim reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@ewjoachim ewjoachim Feb 8, 2019

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

(if we were to do change what this function does, we would also change the doc, but I'm good with that.)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@edmorley edmorley Nov 14, 2022

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Would it be worth explicitely saying that this is an alias of pprint() with sort_dict=False ?

At first glance I was puzzled why both pp() and pprint() existed, and it took a moment to spot the different default sort_dict value - and I ended up having to confirm via source code inspection that there were no other differences between the two.

As such, the above mentioned docs would have been useful for me personally :-)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ewjoachim reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
vadmium
vadmium reviewed Feb 11, 2019
View reviewed changes
Comment thread Misc/NEWS.d/next/Library/2019-02-06-12-07-46.bpo-30670.yffB3F.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/tools/susp-ignored.csv Resolved

Uh oh!

There was an error while loading. Please reload this page.

Rémi Lapeyre added 2 commits February 11, 2019 10:07
Rémi Lapeyre
Remove line numbers in susp-ignored.csv
3f30a20
Rémi Lapeyre
Fix typo in blurb
c286cec
@remilapeyre

remilapeyre commented Feb 11, 2019

Copy link
Copy Markdown
Contributor Author

Thanks @vadmium!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rhettinger
Make minor touch-ups
fbae1d0
* Add "pp" to __all__
* Drop mention of alphabetical sorting. It is just plain sorting
  (i.e. dict with integer keys get sorted as well).
* Fix spelling of "parameter"
@rhettinger
rhettinger merged commit 96831c7 into python:master Mar 22, 2019
@bedevere-bot bedevere-bot removed the awaiting core review label Mar 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vadmium vadmium vadmium left review comments
@tirkarthi tirkarthi tirkarthi left review comments
+3 more reviewers
@edmorley edmorley edmorley left review comments
@ewjoachim ewjoachim ewjoachim approved these changes
@eamanu eamanu eamanu approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

9 participants

@remilapeyre @edmorley @vadmium @ewjoachim @tirkarthi @eamanu @rhettinger @the-knights-who-say-ni @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.