Python文档中的特殊方法在哪里? (__init__,__new__,__len__,...) [英] Where is the Python documentation for the special methods? (__init__, __new__, __len__, ...)
本文介绍了Python文档中的特殊方法在哪里? (__init__,__new__,__len__,...)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
其中是可以在类中使用的特殊双下划线/ dunder方法的完整列表? (例如, __ init __
, __ new __
, __ len __
, __ add __
)
Where is a complete list of the special double-underscore/dunder methods that can be used in classes? (e.g., __init__
, __new__
, __len__
, __add__
)
推荐答案
请参阅特殊方法名称部分。
这篇关于Python文档中的特殊方法在哪里? (__init__,__new__,__len__,...)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文