Title: Use `write` instead of `stream.write` in `PrettyPrinter._pprint_frozendict` · Issue #145887 · python/cpython · GitHub
Open Graph Title: Use `write` instead of `stream.write` in `PrettyPrinter._pprint_frozendict` · Issue #145887 · python/cpython
X Title: Use `write` instead of `stream.write` in `PrettyPrinter._pprint_frozendict` · Issue #145887 · python/cpython
Description: Bug report Bug description: In the recent PR that added frozendict support to pprint (#144908), I let a small inconsistency get through: we set write = stream.write then immediately uses stream.write two lines below: cpython/Lib/pprint.p...
Open Graph Description: Bug report Bug description: In the recent PR that added frozendict support to pprint (#144908), I let a small inconsistency get through: we set write = stream.write then immediately uses stream.wri...
X Description: Bug report Bug description: In the recent PR that added frozendict support to pprint (#144908), I let a small inconsistency get through: we set write = stream.write then immediately uses stream.wri...
Opengraph URL: https://github.com/python/cpython/issues/145887
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Use `write` instead of `stream.write` in `PrettyPrinter._pprint_frozendict`","articleBody":"# Bug report\n\n### Bug description:\n\nIn the recent PR that added `frozendict` support to `pprint` (https://github.com/python/cpython/pull/144908), I let a small inconsistency get through: we set `write = stream.write` then immediately uses `stream.write` two lines below:\n\nhttps://github.com/python/cpython/blob/cd5217283112d41c0244e2d96302cbe33f0b4cb1/Lib/pprint.py#L238-L248\n\ncc @vstinner. May I write the trivial PR?\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-145894\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/devdanzin","@type":"Person","name":"devdanzin"},"datePublished":"2026-03-12T21:34:58.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/145887/cpython/issues/145887"}
| 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:886791f4-2a95-eb71-706d-5cb523d05ba0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D316:5105D:7D3A0A1:AFC1B27:6A503160 |
| html-safe-nonce | 5dcbe1229271fc1ffb5bd79ae2cc6bd934dbc487aea5a53a042206115ec00d3f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMzE2OjUxMDVEOjdEM0EwQTE6QUZDMUIyNzo2QTUwMzE2MCIsInZpc2l0b3JfaWQiOiI0Nzg4Mzc3NDgyOTYwMDU2NjcyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b43c0ff3053717db29812ddb1a8a32bb3c0524822839c0a6d1bb6e4bba8194e4 |
| hovercard-subject-tag | issue:4067405254 |
| 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/145887/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0c40b0c599835f59831da26a458f363034904e17146c6d06f90df01e204741ee/python/cpython/issues/145887 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0c40b0c599835f59831da26a458f363034904e17146c6d06f90df01e204741ee/python/cpython/issues/145887 |
| og:image:alt | Bug report Bug description: In the recent PR that added frozendict support to pprint (#144908), I let a small inconsistency get through: we set write = stream.write then immediately uses stream.wri... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | devdanzin |
| hostname | github.com |
| expected-hostname | github.com |
| None | d6dc8294eb500fa36bbc57472d61fe87c522f9c3c1d64f70f4926f66a66a7efb |
| 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 | d90666eaf032b7eb8975a378efe38e37f4ebb96c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width