How To Use the __str__() and __repr__() Methods in Python
Concise guide: python __str__ vs __repr__ — what each does, when Python calls them, examples, best practices (constructor-like repr, user-friendly str), f-strings, dataclasses, reprlib, logging, and troubleshooting.