Python objects with special methods – Create better classes!
Last updated on October 25, 2026 4:32 amPython objects with special methods - Create better classes!
★★★★★
$449.00 in stock
Udemy.com
as of November 6, 2026 2:32 am
Learn Python’s datamodel with operator overloading and emulate built-in types by implementing magic (dunder) methods
Created by:
Loek van den Ouweland
Passionate Python Teacher
Passionate Python Teacher
Rating:4.81 (48reviews)
450students enrolled
What Will I Learn?
- Explain the origin of the names Python datamodel, magic methods, dunder methods and special methods.
- Write an indexer to support subscripting with the __getitem__ method
- Make objects callable with __call__
- Define the object identity
- Apply __iter__, __next__ to make your objects iterable
- Specify object equality with __eq__, __ne__, __lt__, __gt__, __le__, __ge__
- Wrap existing code into context managers with __enter__ and __exit__
- Describe how objects are constructed by methods __new__ and __init__
Requirements
- Basic knowledge of classes and objects in Python
- Intermediate programming experience
Target audience
- Python programmers who want understand Python better
- Python programmers who want to understand how language features like built-in functions and operators map to special methods in classes


There are no reviews yet.