Menu

July 15, 2025

Python’s Magic Methods: How to Overload Operators Properly

Operator overloading in Python is the ability to give custom behavior to built-in operators like +, -, *, and == when used with your own classes. Magic methods (also called dunder methods) are special methods that start and end with double underscores like __add__, __eq__, and __str__ that Python automatically calls when you use operators […]

Python’s Magic Methods: How to Overload Operators Properly Read More »

Understanding Python Descriptors and the __set_name__ Method

Custom descriptors are Python objects that control how attributes are accessed, set, or deleted on other objects. The __set_name__ method is a special hook introduced in Python 3.6 that automatically tells descriptors their name and owner class when the class is created. This eliminates the need for manual name passing or complex metaclass solutions. If

Understanding Python Descriptors and the __set_name__ Method Read More »

Python @property: Getters, Setters, and Attribute Control Guide

Property decorators in Python allow you to combine the elegance of dot notation with the power of validation and control. Properties let you access methods like attributes while maintaining control over how data is accessed, set, and validated, giving you both the simplicity of direct attribute access and the safety of explicit getter and setter

Python @property: Getters, Setters, and Attribute Control Guide Read More »

Python Method Decorators- @classmethod vs @staticmethod vs @property

Class methods, static methods, and property decorators are three powerful Python features that control how methods behave in classes. Class methods work with the class itself rather than instances, static methods are independent utility functions within a class, and property decorators turn methods into attributes that can validate and control access to data. These decorators

Python Method Decorators- @classmethod vs @staticmethod vs @property Read More »

Scroll to Top
Course Preview

Machine Learning A-Z™: Hands-On Python & R In Data Science

Free Sample Videos:

Machine Learning A-Z™: Hands-On Python & R In Data Science

Machine Learning A-Z™: Hands-On Python & R In Data Science

Machine Learning A-Z™: Hands-On Python & R In Data Science

Machine Learning A-Z™: Hands-On Python & R In Data Science

Machine Learning A-Z™: Hands-On Python & R In Data Science

Scroll to Top