Python’s magic methods

Here are some links to documentation of Python’s magic methods, aka special methods, aka “dunder” (double underscore) methods.

There are also a few other Python features that are sometimes characterized as “magic”.

I’m sure there are other useful Web pages about magic methods that I haven’t found. If you know of one (and feel like sharing it) note that you can code HTML tags into a WordPress comment, like this, and they will show up properly formatted:

I found a useful discussion of magic methods at
<a href=""></a>


This entry was posted in Python features. Bookmark the permalink.

2 Responses to Python’s magic methods

  1. Nick Coghlan says:

    It’s slightly dated now (around the 2.5 era), but I wrote a summary of the magic method protocols a few years back:

  2. Steve Ferg says:

    Interesting discussion of __deepcopy__ at

Comments are closed.