pythonclassmagic-methods

Where is the Python documentation for the special methods? (__init__, __new__, __len__, ...)


Where is a complete list of the special double-underscore/dunder methods that can be used in classes? (e.g., __init__, __new__, __len__, __add__)


Solution

  • Please take a look at the special method names section in the Python language reference.