GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Teach `pprint` about `frozendict` · Issue #145070 · python/cpython Closed Labels easystdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement DescriptionFeature or enhancementProposal:The >>> f = frozendict.fromkeys(range(10)) >>> g = frozendict.fromkeys(range(10)) >>> h = {0: f, 1: frozendict({2: g})} >>> pprint.pp(h) {0: frozendict({0: None, 1: None, 2: None, 3: None, 4: None, 5: None, 6: None, 7: None, 8: None, 9: None}), 1: frozendict({2: frozendict({0: None, 1: None, 2: None, 3: None, 4: None, 5: None, 6: None, 7: None, 8: None, 9: None})})} We want >>> f = frozendict.fromkeys(range(10)) >>> g = frozendict.fromkeys(range(10)) >>> h = {0: f, 1: frozendict({2: g})} >>> pprint.pp(h) {0: frozendict({0: None, 1: None, 2: None, 3: None, 4: None, 5: None, 6: None, 7: None, 8: None, 9: None}), 1: frozendict({2: frozendict({0: None, 1: None, 2: None, 3: None, 4: None, 5: None, 6: None, 7: None, 8: None, 9: None})})} Let me know whether you think the pretty printing should be different. cc: @rhettinger for validating that the pretty printing should be as above. I'll create a trivial PR to fix this once validated. Has this already been discussed elsewhere?This is a minor feature, which does not need previous discussion elsewhere Links to previous discussion of this feature:No response Activity
MetadataMetadataAssigneesLabelseasystdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402520 — 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. |