Factory that returns a pprint function used by the default pprint of dicts and dict proxies.
(start, end)
| 683 | |
| 684 | |
| 685 | def _dict_pprinter_factory(start, end): |
| 686 | """ |
| 687 | Factory that returns a pprint function used by the default pprint of |
| 688 | dicts and dict proxies. |
| 689 | """ |
| 690 | def inner(obj, p, cycle): |
| 691 | if cycle: |
| 692 | return p.text('{...}') |
| 693 | step = len(start) |
| 694 | p.begin_group(step, start) |
| 695 | keys = obj.keys() |
| 696 | for idx, key in p._enumerate(keys): |
| 697 | if idx: |
| 698 | p.text(',') |
| 699 | p.breakable() |
| 700 | p.pretty(key) |
| 701 | p.text(': ') |
| 702 | p.pretty(obj[key]) |
| 703 | p.end_group(step, end) |
| 704 | return inner |
| 705 | |
| 706 | |
| 707 | def _super_pprint(obj, p, cycle): |
no outgoing calls
no test coverage detected
searching dependent graphs…