Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Python Magic Methods and Dunder Functions - A Comprehensive Guide

Tech with Tim via YouTube

Overview

Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
Learn about Python's powerful "Dunder" (double underscore) or Magic Methods in this comprehensive 25-minute tutorial video that transforms how you view Python code. Explore fundamental concepts starting with Python objects and their behavior, then advance to creating custom dunder methods for enhanced functionality. Master essential methods like str() and repr() for object representation, implement arithmetic and comparison operations, understand indexing with obj[x] syntax, work with context managers for resource handling, and harness the power of iterators. Through practical demonstrations and clear explanations, gain the skills to leverage these special methods that make Python objects behave like built-in types, enabling more elegant and pythonic code design.

Syllabus

| Dunder Methods
| Understanding Python Objects
| Writing Your Own Dunder Methods
| str and repr
| Arithmetic and Comparison
| Indexing obj[x] = value
| Context Managers
| Iterators

Taught by

Tech With Tim

Reviews

Start your review of Python Magic Methods and Dunder Functions - A Comprehensive Guide

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.