Tagged articles
22 articles
Page 1 of 1
IT Services Circle
IT Services Circle
Sep 3, 2025 · Fundamentals

Unlock Python’s Magic: Master Dunder Methods for Cleaner, Powerful Code

Learn how Python’s special “dunder” methods like __str__, __add__, __eq__, __iter__, and others let you customize object representation, arithmetic, comparison, and iteration, turning your classes into intuitive, built‑in‑type equivalents with clear examples and practical code snippets.

Code ExamplesObject-OrientedPython
0 likes · 8 min read
Unlock Python’s Magic: Master Dunder Methods for Cleaner, Powerful Code
Data STUDIO
Data STUDIO
Aug 26, 2025 · Fundamentals

How Python Dunder Methods Make Your Code Cleaner and More Powerful

This article explains Python's dunder (double‑underscore) magic methods, showing how overriding __str__, __repr__, __add__, __eq__, __iter__, and others lets custom classes behave like built‑in types, with concrete examples such as Book, Wallet, and TransactionHistory.

Pythoncustom classesdunder methods
0 likes · 6 min read
How Python Dunder Methods Make Your Code Cleaner and More Powerful
Data Party THU
Data Party THU
Aug 19, 2025 · Fundamentals

5 Hidden Python Features That Can Supercharge Your Code

This article uncovers five lesser‑known Python features—contextlib.suppress, sys.setrecursionlimit, typing.Literal, the __missing__ magic method, and __subclasshook—explaining when to use them, showing concise code examples, and highlighting the practical benefits they bring to everyday programming.

Advanced FeaturesCode OptimizationPython
0 likes · 7 min read
5 Hidden Python Features That Can Supercharge Your Code
php Courses
php Courses
Apr 1, 2025 · Fundamentals

Understanding Python Magic (Dunder) Methods

This article explains Python's magic (dunder) methods, categorizing them by purpose—construction, representation, comparison, arithmetic, container behavior, callability, and context management—and provides clear code examples illustrating how to customize class behavior for more Pythonic, intuitive objects.

Object-OrientedPythondunder methods
0 likes · 11 min read
Understanding Python Magic (Dunder) Methods
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
Aug 7, 2024 · Fundamentals

Master Python’s __new__, __init__, and __del__ Magic Methods with Real Code Examples

This article explains how Python’s __new__, __init__, and __del__ magic methods work, shows when to use each, and provides step‑by‑step code examples—including singleton creation, inheritance initialization, resource cleanup, and metaclass usage—to help developers master object lifecycle control.

Object LifecyclePythonTutorial
0 likes · 6 min read
Master Python’s __new__, __init__, and __del__ Magic Methods with Real Code Examples
php Courses
php Courses
Sep 25, 2023 · Backend Development

Advanced PHP Features: Magic Methods, Type Hints, Closures, Namespaces, Generators, Iterators, Date/Time, Regex, and Variable Scope

This article provides a comprehensive guide to advanced PHP features, covering magic methods, type hints, closures, namespaces, generators, iterators, date/time handling, regular expressions, and variable scope, each explained with clear descriptions and practical code examples for backend developers.

Backend DevelopmentGeneratorsIterators
0 likes · 18 min read
Advanced PHP Features: Magic Methods, Type Hints, Closures, Namespaces, Generators, Iterators, Date/Time, Regex, and Variable Scope
php Courses
php Courses
Aug 24, 2023 · Backend Development

Accessing Private Members in PHP with __get(), __set() and ArrayAccess

This article explains why PHP throws "attempt to access private member" errors, describes the visibility keywords public, protected, private, and demonstrates how to use the magic methods __get() and __set() as well as the ArrayAccess interface to read and write private properties from outside the class.

ArrayAccessObject-OrientedPHP
0 likes · 5 min read
Accessing Private Members in PHP with __get(), __set() and ArrayAccess
Laravel Tech Community
Laravel Tech Community
Jun 20, 2023 · Backend Development

Understanding PHP Magic Methods: Constructors, Destructors, Call, CallStatic, Get, Set, Isset, Unset, Sleep and Wakeup

This article explains the purpose, declaration syntax, usage rules, and practical examples of PHP's magic methods—including __construct, __destruct, __call, __callStatic, __get, __set, __isset, __unset, __sleep, and __wakeup—providing clear code snippets and output demonstrations for each.

OOPPHPmagic methods
0 likes · 16 min read
Understanding PHP Magic Methods: Constructors, Destructors, Call, CallStatic, Get, Set, Isset, Unset, Sleep and Wakeup
MaGe Linux Operations
MaGe Linux Operations
Dec 24, 2022 · Fundamentals

Unlock Python’s Magic Methods: A Practical Guide to Special Attributes

This article explains Python’s special attributes and magic methods—including __hash__, __eq__, __bool__, __repr__, __str__, and context management—showing how they affect object behavior, hashing, equality, truth testing, representation, and resource handling with clear code examples.

Context managementPythonReflection
0 likes · 14 min read
Unlock Python’s Magic Methods: A Practical Guide to Special Attributes
php Courses
php Courses
Jun 27, 2022 · Backend Development

Understanding PHP Magic Methods: Definitions and Use Cases

This article explains PHP's magic methods—functions prefixed with double underscores—detailing each method’s purpose such as constructors, destructors, property accessors, call handlers, serialization hooks, cloning, and debugging, providing a concise reference for backend developers.

OOPmagic methodsprogramming
0 likes · 4 min read
Understanding PHP Magic Methods: Definitions and Use Cases
Python Programming Learning Circle
Python Programming Learning Circle
Apr 19, 2021 · Fundamentals

Understanding Python Magic (Dunder) Methods

This article explains Python's built‑in magic (dunder) methods—functions that start and end with double underscores—showing how they enable custom class behavior such as indexing, iteration, string representation, callable objects, context management, object creation, and attribute handling with clear code examples.

Callable ObjectsIteratorsPython
0 likes · 14 min read
Understanding Python Magic (Dunder) Methods
php Courses
php Courses
Mar 12, 2021 · Backend Development

Understanding PHP Magic Methods: __construct, __destruct, __call, and More

This article explains the purpose, behavior, and typical usage of PHP's magic methods—including __construct, __destruct, __call, __callStatic, __get, __set, __isset, __unset, __sleep, __wakeup, __toString, __invoke, __set_state, __clone, __autoload, and __debugInfo—providing clear definitions, explanations, and code examples for each.

Object-OrientedPHP8Tutorial
0 likes · 7 min read
Understanding PHP Magic Methods: __construct, __destruct, __call, and More
Python Crawling & Data Mining
Python Crawling & Data Mining
Jul 3, 2020 · Fundamentals

Unlock Python’s Power: A Practical Guide to Magic Methods

This article introduces Python’s magic methods, explains their purposes and usage, provides a comprehensive table of common dunder methods, and demonstrates practical examples—including object creation, attribute handling, container behavior, and context management—to help developers master these powerful language features.

Code ExamplesObject-OrientedPython
0 likes · 14 min read
Unlock Python’s Power: A Practical Guide to Magic Methods
21CTO
21CTO
May 21, 2018 · Backend Development

Mastering PHP Magic Methods: 16 Essential Tricks for Developers

This guide explains the 16 most important PHP magic methods, showing when they are invoked, how to declare them, and providing clear code examples for constructors, destructors, property accessors, cloning, serialization, autoloading, and debugging to help developers write more robust object‑oriented code.

PHPmagic methodsobject‑oriented programming
0 likes · 19 min read
Mastering PHP Magic Methods: 16 Essential Tricks for Developers
MaGe Linux Operations
MaGe Linux Operations
Apr 6, 2018 · Fundamentals

Unlock Python’s Power: Master Magic Methods for Advanced Object Behavior

This article explains Python’s magic methods—special double‑underscore functions like __init__, __new__, __getattr__, and __call__—showing how they control object construction, attribute access, custom containers, callability, context management, descriptors, and copying, with clear code examples for each feature.

CallableObject-Orientedcontext-manager
0 likes · 15 min read
Unlock Python’s Power: Master Magic Methods for Advanced Object Behavior