· 3 min read

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 snake coiled around a class inheritance tree with an Eiffel Tower silhouette and floating flashcards

Studying. But it's also a video game. 🎮

Flashcards, quizzes and games that make you actually remember.

Start playing — it's free

Posted by

Deck EO1367 – Python : fondamentaux de la POO is the French edition of our English Python OOP deck: the same 59 concepts, with the Python term on the front and a French explanation on the back. Use it if you study informatique in French, read French tutorials, or need to explain classes to French-speaking teammates.

Study this deck: Python : fondamentaux de la POO

1 / 10
Question

Class in Python

Knew itLearning

Tap the card for the answer · swipe right if you knew it, left if not

Sample cards (real French backs)

FrontBack
InstanceUn objet créé à partir d'une classe. Chaque instance possède ses propres données mais partage les méthodes.
Class attributesVariables partagées par toutes les instances, définies directement dans le corps de la classe.
Method overridingLa classe enfant redéfinit une méthode de la classe parente… On peut appeler la version parente avec super().
MROOrdre dans lequel Python recherche les méthodes… Utilise la linéarisation C3.
Name mangling__attribute devient _ClassName__attribute. Ce n'est pas un mécanisme de sécurité, juste une convention.
__repr__Représentation destinée aux développeurs, non ambiguë… Sert de repli pour __str__.
__enter__ and __exit__Méthodes de gestionnaire de contexte pour l'instruction with.
__del__Destructeur appelé lorsque l'objet est récupéré par le ramasse-miettes… utiliser plutôt des gestionnaires de contexte.
Dataclass@dataclass génère automatiquement __init__, __repr__, __eq__. Réduit le code répétitif.

What the deck covers

Classes, instances, self, __init__, instance vs class attributes, instance/class/static methods (@classmethod, @staticmethod), inheritance, super(), multiple inheritance and MRO, polymorphism, encapsulation, private attributes, @property getters and setters, dunder methods (__str__, __len__, __getitem__, __setitem__, __eq__, __add__, __call__, __iter__, __next__, __bool__, __hash__), duck typing, isinstance(), issubclass(), getattr()/setattr()/delattr(), __dict__, __class__, ABCs, __new__, singletons, composition over inheritance, method chaining, descriptors, __slots__, __getattr__ vs __getattribute__ and metaclasses.

The French vocabulary to lock in

  • redéfinition = overriding. Don't confuse it with surcharge, which means overloading. Many French tutorials use the two interchangeably, and the deck uses the right word.
  • méthode magique (or méthode spéciale) = dunder method; ramasse-miettes = garbage collector; gestionnaire de contexte = context manager; interface fluide = fluent interface; code répétitif = boilerplate.
  • Several English terms stay untranslated in French code reviews: name mangling, duck typing, slots.

Tips specific to this deck

  1. Fix the capitals when you review. Some fronts were sentence-cased automatically (Self, Super(), Isinstance(), Getattr(), Type()). Python is case-sensitive, so read them as self, super(), isinstance(). Typing Self in a method signature does not do the same thing.
  2. Add nuance to three backs. An ABC subclass can only not be instantiated if it still has an unimplemented @abstractmethod. Defining __eq__ without __hash__ sets __hash__ to None, so your objects can't go into a set. The singleton on card 50 stores cls.instance, which subclasses inherit through hasattr, so a subclass returns the parent's instance. Use a cls.__dict__ check if you subclass it.

If you'd rather revise the same material in German, see our Python built-ins Eingebaute Funktionen edition.

Open Flip It and search for deck code EO1367.

Ready to learn faster? 🚀

Join FLIP IT for free and turn studying into a game.

Create my free account