Today I learned about a relatively new PEP to improve pretty printing in Python. 🤩

https://peps.python.org/pep-0813/

#Python

PEP 813 – The Pretty Print Protocol | peps.python.org

This PEP describes the “pretty print protocol”, a collection of changes proposed to make pretty printing more customizable and convenient.

Python Enhancement Proposals (PEPs)
@mahryekuh It's not accepted yet, so it's helpful to give feedback on the thread, even if only to say you like and would use it.
https://discuss.python.org/t/pep-813-the-pretty-print-protocol/106242
#Python
PEP 813 - The Pretty Print Protocol

A couple of the elder statesmen are happy to announce PEP 813, a proposal to build-in optional pretty printing for print(), str.format(), and f-strings, and to define a protocol classes can implement to participate in and customize how their instances are pretty printed. Enjoy, and let the games begin!

Discussions on Python.org