Improving pretty-printing in Python
Improving pretty-printing in Python
Posted Mar 21, 2020 7:22 UTC (Sat) by divbzero (guest, #137744)Parent article: Improving pretty-printing in Python
I don’t have a strong opinion on this, but would note that the debate over a __pretty__ method seems to parallel the debate over a __json__ method. [1] [2]
[1]: https://bugs.python.org/issue27362
[2]: https://mail.python.org/pipermail/python-ideas/2010-July/...
__json__ has not gained traction, probably because JSON serialization can be application dependent and JSONDecoder already provides a flexible way to customize JSON serialization.
__pretty__ seems even more in the eye of the beholder so I’m not surprised to see hesitant reactions to the idea.