Tous les livres

Professionnel

Applis À propos Coach Connexion Commencer la lecture

Computer Science · Glossaire

Qu'est-ce que « Special method » ?

Definition 23.5 High School Computer Science · Chapitre 23 — Classes and Objects

A special method is a method with a name of the form __name__ that Python calls by itself for an operation of the language: __add__ for +, __eq__ for ==, __lt__ for <, __len__ for len, __str__ for str and print, __repr__ for the form shown in lists and for programmers.

Lire dans le chapitre →