Skip to content

Glossary: Python Beyond the Basics

special method

Also written: dunder method, magic method, special methods

A method with two underscores at each end, like `__init__` or `__repr__`, that Python calls automatically to hook your objects into printing, comparing and sorting.

Where the book teaches it

Related terms

__init____repr____eq__ / __lt__