Tagged articles
7 articles
Page 1 of 1
Test Development Learning Exchange
Test Development Learning Exchange
Jan 7, 2025 · Fundamentals

Understanding Classes and Objects in Python: Concepts, Inheritance, Special Methods, and Advanced Examples

This article introduces Python's class and object fundamentals, covering class definitions, instance and class variables, inheritance, special (dunder) methods, and advanced examples such as encapsulation, operator overloading, and the use of class and static methods, all illustrated with clear code snippets.

InheritanceOOPObjects
0 likes · 10 min read
Understanding Classes and Objects in Python: Concepts, Inheritance, Special Methods, and Advanced Examples
Test Development Learning Exchange
Test Development Learning Exchange
Oct 30, 2024 · Fundamentals

Understanding Python Magic (Dunder) Methods: Definitions, Examples, and Best Practices

This article explains Python magic (dunder) methods, their purposes, common examples such as __init__, __str__, __repr__, __len__, __getitem__, __setitem__, __delitem__, __iter__, __call__, __add__, __eq__, __hash__, and shows how to implement operator overloading, iterator and context‑manager protocols while discussing naming rules, performance, inheritance, type checking, and limitations.

Iterator ProtocolPythonSpecial Methods
0 likes · 19 min read
Understanding Python Magic (Dunder) Methods: Definitions, Examples, and Best Practices
Test Development Learning Exchange
Test Development Learning Exchange
Oct 4, 2024 · Fundamentals

Unlock Python’s Power: Master Magic Methods for Advanced OOP

This tutorial explains Python’s magic (special) methods—including initialization, string representation, arithmetic, comparison, container protocols, iteration, attribute handling, context management, and callable behavior—showing how each method works with clear code examples to make classes more flexible and powerful.

PythonSpecial MethodsTutorial
0 likes · 9 min read
Unlock Python’s Power: Master Magic Methods for Advanced OOP
Test Development Learning Exchange
Test Development Learning Exchange
Dec 27, 2019 · Fundamentals

Understanding Python's Special Methods __len__ and __getitem__ with Example Code

This article explains Python’s double‑underscore special methods such as __len__ and __getitem__, demonstrates their implementation in a FrenchDeck class with example code, shows how they enable built‑in functions like len() and indexing, and further illustrates additional dunder methods using a Vector class.

Object-OrientedSpecial Methodsdunder
0 likes · 4 min read
Understanding Python's Special Methods __len__ and __getitem__ with Example Code