If I’ve read the news correctly, the new repl uses pprint under the hood to display things.
With raw pprint, I believe that one can customise the way stuff is displayed. Is there any path to bring able to do that in the standard repl in an import? I.e can a library customise its types through some cunning import / given strategy? I believe the answer is no, but checking…
You can customize pprint by making an amended copy as per PPrint (I do this myself for various nefarious purposes), but you would need to be able to substitute in your own customised instance into the REPL environment.
Are there any hooks into the REPL for that?
Sounds like a job for Claude and a Caerphilly-phrased pull request…
by making an amended copy as per Print
Yes, this was exactly the route I attempted to follow. I suspect that the printer for the repl is somehow shaded or removed from view to avoid conflicts, thus preventing exactly this sort of abuse :-D…
Before unleashing an AI (that I don’t understand) to make a pull request (which I almost certainly wouldn’t understand) I’ll leave this discussion open to see if there’s any interest in the disucssion on whether
“ Is user / library space modificiation of the standard repl pprinter a desirable feature” ?
On balance, I think that I would like it…