Python Magic Methods You Might Not Have Heard About

There are many less-known Python magic methods—let’s find out what they do and how we can use them in our code

Martin Heinz
Towards Data Science
7 min readDec 14, 2022

--

Photo by Aaron Huber on Unsplash

Python’s magic methods — also known as dunder (double underscore) methods — can be used to implement a lot of cool things. Most of the time we use them for simple stuff, such as constructors…

--

--