Introduction

In Python, there are a lot of methods and attributes that start and end with double underscores. These are called dunder methods and Dunder attributes. (They are also called magic methods and magic attributes)

Most of them have derived from the early prototypes of Python, and they are used to implement a lot of the language’s features. This means that some of them should not be used directly or overridden, unless you know what you are doing. Plus, some of them are rarely used.

Let’s take a look at some of them. There are:

See also [[name and main]] and [[init vs new]]