Special (magic) methods in Python

What are all the special (magic) methods in Python? __xxx__ methods, that is.

I often look for a way to override what I know can be done using one of these methods, but it's hard for me to find how, as far as I can tell, there is no final list of these PLUS methods, their names are not really Google friendly . So I think having a list of those here on SO would be a good idea.

+48
python
Jul 07 '09 at 6:06
source share
1 answer

At the python level, most of them are documented in the help system . At C level, you can find it in the object protocol section (strictly speaking, you only have a subset here).

+47
Jul 07 '09 at 6:11
source share



All Articles