Python objects with special methods - Create better classes!
Learn Python’s datamodel with operator overloading and emulate built-in types by implementing magic (dunder) methods
4.81 (48 reviews)

451
students
2 hours
content
Aug 2024
last update
$49.99
regular price
What you will 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__
Related Topics
3984080
udemy ID
4/15/2021
course created date
5/30/2021
course indexed date
Bot
course submited by