> On Mar 1, 2017, at 9:35 AM, Paul Moore <[email protected]> wrote: > >> On 1 March 2017 at 13:50, Steven D'Aprano <[email protected]> wrote: >> It is possible that we could come up with a pretty-printing protocol, >> but that wouldn't be a trivial job. > > I'd be inclined to do this via simplegeneric. Let pprint do what it > currently does, but allow users to register implementations for > specific classes as they wish.
If you mean functools.singledispatch, then I agree. It's even mentioned as a motivating case in PEP 443. > I'm not sure how much work this would be - maybe a 3rd party "better > pprint" module could prototype the approach to see if it's practical. > Paul That seems reasonable. Eric. _______________________________________________ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
