> On Mar 1, 2017, at 9:35 AM, Paul Moore <p.f.mo...@gmail.com> wrote:
> 
>> On 1 March 2017 at 13:50, Steven D'Aprano <st...@pearwood.info> 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
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to