Python Dunder Magic 🐍

Python Dunder Magic 🐍

Subscribe to my newsletter and never miss my upcoming articles

Dunder methods in Python not only helps in operator overloading, but it gives the power to instantiate a class however we want (talking about __new__ method).

In my opinion, most important β€œDunder” or β€œMagic” methods that everyone should consider while building a class are:

βœ” __new__
βœ” __repr__
βœ” __getattr__ and __setattr__
βœ” __iter__ and __next__
βœ” __enter__ and __exit__

What are some of your most commonly used dunder methods that you consider while designing a class ?


Just starting you Open Source Journey ? Don't forget to check out Hello Open Source

Want to ++ your GitHub Profile README ? Check out Quote - README

Want to make a simple and awesome game from scratch ? Check PongPong

Till next time !

Namaste πŸ™

Β 
Share this