3 Special Methods for Object String Formatting in Python
Formatting Python custom objects in a user-friendly way
Published in
5 min readFeb 15, 2021
In Python, underscores have special meanings when they’re used in attribute names. A particular form is the use of two pairs of double underscores with one before and the other after the attribute name, which are termed special methods or magic methods.