来自《流畅的python》
字符串、字节序列:__repr__、__str__、__format__、__bytes__
数值转换:__abs__、__bool__、__complex__、__int__、__float__、__hash__、__index__
集合模拟:__len__、__getitem__、__setitem__、__delitem__、__contains__
迭代枚举:__iter__、__reversed__、__next__
可调用模拟:__call__
上下文管理:__enter__、__exit__
实例创建和销毁:__init__、__new__、__del__
属性管理:__getattr__、__getattribute__、__setattr__、__delattr__、__dir__
属性描述符:__get__、__set__、__delete__
跟类相关的服务:__prepare__、__instancecheck__、__subclasschek__
跟运算符相关的特殊方法:
一元运算符:__neg__ - 、__pos__ + 、 __abs__ abs()
众多比较运算符: __lt__ < 、__le__ <=、__eq__ == 、__ne__ != 、__gt__ >、__ge__ >=
算术运算符:__add__ + 、__sub__ - 、__mul__ * 、__truediv__ /、__floordiv__ //、__mod__ %
__divmod__ divmod()、__pow__ **或pow() 、__round__ round()