Learn Python OOP: 59 Flashcards from __init__ and self to Dunder Methods and Metaclasses
Master Python OOP with 59 flashcards: classes, self, super() and MRO, @property, dunder methods, __slots__, dataclasses, ABCs and metaclasses, with study tips.

Studying. But it's also a video game. 🎮
Flashcards, quizzes and games that make you actually remember.
Posted by
Related reading
Learn Python OOP in German: 59 Flashcards on Klassen, Vererbung and Magische Methoden
Study Python OOP with German explanations: 59 real flashcards on Klassen, Vererbung, MRO, Kapselung and dunder methods, plus 4 cards to fix and überschreiben vs überladen.
Master Python OOP in Spanish: 59 Flashcards on Clases, Herencia and Métodos Mágicos
Learn Python object-oriented programming with Spanish explanations: 59 real flashcards on clases, herencia, MRO, métodos mágicos and the Spanish terms to know.
Learn Python OOP in French: 59 Flashcards on Classes, Héritage and Méthodes Magiques
Study Python object-oriented programming in French with deck EO1367: 59 flashcards on classes, self, super(), MRO, dunder methods, @property and metaclasses.
Python's object model looks simple — class, __init__, self — until you hit super(), the MRO, @property setters and dunder methods. Deck WX8019 "Python: OOP Fundamentals" packs that whole path into 59 cards, from your first class definition to descriptors and metaclasses. The content is accurate and code-heavy; here's how to get the most out of it.
Study this deck: Python: OOP Fundamentals
1 / 10Class in Python
Tap the card for the answer · swipe right if you knew it, left if not
Cards worth knowing by heart
| Front | Back |
|---|---|
| instance vs class attributes | Instance attributes are unique per instance (self.attr); class attributes are shared (ClassName.attr). Lookup checks the instance first, then the class. |
| Class methods | Decorated with @classmethod, take cls as first parameter, e.g. def from_string(cls, string): |
| MRO (Method Resolution Order) | Order Python searches for methods; view with ClassName.mro(). Uses C3 linearization. |
| Name mangling | __attribute becomes _ClassName__attribute. Avoids name clashes in inheritance, not security. |
__str__ vs __repr__ | __str__ is readable for users, __repr__ unambiguous for developers — and the fallback if __str__ is missing. |
__new__ vs __init__ | __new__ creates the instance, __init__ initializes it; __new__ runs first. |
| Slots in Python classes | __slots__ restricts attributes, saves memory, no __dict__. |
__getattr__ vs __getattribute__ | __getattr__ is a fallback for missing attributes; __getattribute__ runs on every access. |
| Metaclass | The class of a class: class MyClass(metaclass=Meta). |
What you'll cover
Classes and instances, self, __init__, instance, class and static methods, inheritance, method overriding, super(), multiple inheritance, MRO, polymorphism, duck typing, encapsulation, private attributes, name mangling, @property getters and setters, dunder methods (__str__, __repr__, __len__, __getitem__, __setitem__, __eq__ and the comparison family, __add__, __call__, __iter__, __next__, __enter__/__exit__, __hash__, __bool__, __del__), isinstance, issubclass, type, hasattr, getattr, setattr, delattr, __dict__, __class__, abstract base classes, @dataclass, the singleton pattern, composition over inheritance, method chaining, the descriptor protocol, __slots__ and metaclasses.
Study tips specific to this deck
Fix the capital letters as you go. Several fronts were auto-capitalized: Self, Super(), Isinstance(), Issubclass(), Hasattr(), Getattr(), Setattr(), Delattr(). Python is case-sensitive — Isinstance(x, int) raises NameError. Retype them as self, super(), isinstance() so you memorize the real spelling.
Pair the dunder cards with the operator they hook. Quiz yourself in reverse: see len(obj), obj[k] = v, a + b, with x: or obj() and name the method (__len__, __setitem__, __add__, __enter__/__exit__, __call__). That's how you'll meet them in real code.
Add one missing rule to the __hash__ card (54). "Immutable objects only" is too vague. The rule that bites people: if you define __eq__ without __hash__, Python sets __hash__ to None and your objects can no longer go in a set or be dict keys. Hash only on fields that never change. Also note the singleton card (50): hasattr(cls, 'instance') is also true for subclasses, so a subclass would return the parent's instance.
Card 56 on descriptors is the bridge to our Advanced Python decorators and descriptors guide; for the design side (composition, SOLID), continue with Design Patterns and SOLID.
Ready to learn faster? 🚀
Join FLIP IT for free and turn studying into a game.