# Dunder Method

say it: **“DUN-der METH-ud”** **/ˈdʌndər ˈmɛθəd/**

A method with double underscores, like \_\_len\_\_, that Python calls for you.

## What is a **dunder method**?

A **dunder method** has double underscores on both sides, like `__init__` or `__len__`. Python calls these for you at the right moment, such as when you use `len()` on your object.

```python
class Playlist:
    def __init__(self, songs):
        self.songs = songs

    def __len__(self):
        return len(self.songs)

print(len(Playlist(["A", "B", "C"])))  # 3
```

Level: Journeyman · [More Python terms at this level](https://www.ask-codey.com/glossary?category=python&level=3)

Updated: November 17, 2026

Source: https://www.ask-codey.com/glossary/dunder-method
