Title: Improve documentation for `pprint` module · Issue #115986 · python/cpython · GitHub
Open Graph Title: Improve documentation for `pprint` module · Issue #115986 · python/cpython
X Title: Improve documentation for `pprint` module · Issue #115986 · python/cpython
Description: Documentation The documentation for the pprint module could be improved in many respects: Most users will probably only ever need to use pprint.pp() or pprint.pprint(), but these are buried halfway down the module. It would be nice if th...
Open Graph Description: Documentation The documentation for the pprint module could be improved in many respects: Most users will probably only ever need to use pprint.pp() or pprint.pprint(), but these are buried halfway...
X Description: Documentation The documentation for the pprint module could be improved in many respects: Most users will probably only ever need to use pprint.pp() or pprint.pprint(), but these are buried halfway...
Opengraph URL: https://github.com/python/cpython/issues/115986
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Improve documentation for `pprint` module","articleBody":"# Documentation\r\n\r\nThe documentation for the `pprint` module could be improved in many respects:\r\n- Most users will probably only ever need to use `pprint.pp()` or `pprint.pprint()`, but these are buried halfway down the module. It would be nice if these were the first things on the page.\r\n- All examples in the documentation use `pprint.pprint()`, which has some unexpected behaviour. For example, it sorts dictionaries by default, which is somewhat unintuitive now that dictionaries maintain insertion order. I suggest we change the examples to use `pprint.pp()` instead, which has the more intuitive default of `sort_dicts=False`.\r\n- Similarly, the docs for `pprint.pprint()` could explicitly call out that it has unintuitive defaults for things such as `sort_dicts` and link to `pprint.pp()`\r\n- Some links in the module's documentation incorrectly point to the module itself (`pprint`) instead of the function `pprint.pprint()`.\r\n\r\nThese don't all necessarily need to be tackled in the same PR\r\n\r\n\u003c!-- gh-linked-prs --\u003e\r\n### Linked PRs\r\n* gh-116019\r\n* gh-116061\r\n* gh-116064\r\n* gh-116085\r\n* gh-116104\r\n* gh-116382\n* gh-116383\n* gh-116614\n* gh-117196\n* gh-117197\n* gh-117401\n* gh-117403\n* gh-118146\n* gh-121098\n* gh-121099\n\u003c!-- /gh-linked-prs --\u003e\r\n","author":{"url":"https://github.com/AlexWaygood","@type":"Person","name":"AlexWaygood"},"datePublished":"2024-02-27T10:11:05.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":15},"url":"https://github.com/115986/cpython/issues/115986"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:49503a36-6598-3c96-41c4-811d68602c84 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D1C6:C9EB4:1F91A9D:2907F82:696B4637 |
| html-safe-nonce | f9b3bfb920b9650177598670f458d1a84f1375efa186b086cccbcbf9663741ef |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMUM2OkM5RUI0OjFGOTFBOUQ6MjkwN0Y4Mjo2OTZCNDYzNyIsInZpc2l0b3JfaWQiOiI4MzI1MTk1MzY5NDQzNzA2NDIzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | cd05058f0b25c599921659c60a407ebea3d8fade1912988b5e08d44bb68bf353 |
| hovercard-subject-tag | issue:2156189590 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/115986/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c75fc856457ac939f744cba584f4eb988b93b025a3c341eec9c3bf9060e6e78c/python/cpython/issues/115986 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c75fc856457ac939f744cba584f4eb988b93b025a3c341eec9c3bf9060e6e78c/python/cpython/issues/115986 |
| og:image:alt | Documentation The documentation for the pprint module could be improved in many respects: Most users will probably only ever need to use pprint.pp() or pprint.pprint(), but these are buried halfway... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | AlexWaygood |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width