[issue39994] pprint handling of dict subclasses that override __repr__

Eric V. Smith report at bugs.python.org
Sat Aug 15 11:28:33 EDT 2020


Eric V. Smith <eric at trueblade.com> added the comment:

I realize it might break some corner cases, but I really think we should re-write pprint to use functools.singledispatch. Or if the breakage isn't acceptable, abandon it and create a new module that does use singledispatch. That way it would be easily extensible.

pprint currently works with a dispatch table (_dispatch), it's just hidden.

@fdrake: From the comments: "If you find it useful, thank small children who sleep at night". I assume they're not small anymore!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39994>
_______________________________________


More information about the Python-bugs-list mailing list