On 3/15/2020 12:50 PM, Steve Jorgensen wrote:
Guido van Rossum wrote:
I think the idea you're looking for is an alternative for the pprint module
that allows classes to have formatting hooks that get passed in some
additional information (or perhaps a PrettyPrinter object) that can affect
the formatting.
This would seem to be an ideal thing to try to design and put on PyPI,
except it would be more effective if there was a standard, rather than
several competing such modules, with different APIs for the formatting
hooks.
So I encourage having a discussion (might as well be here) about the design
of the new PrettyPrinter API.
I like it. :)
I'll do some prototyping to see if I come up with any promising patterns.
Back when singledispatch was added, pretty printing was used as a
motivating example. I think that would be a good pattern to use.
Eric
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/python-ideas@python.org/message/DQPKQRSBWF64ZLZ5LR4MVCF77VOGT7CT/
Code of Conduct: http://python.org/psf/codeofconduct/