AdvancePython
latest
第一章:导论
第二章:Python 一切皆对象
第三章:魔法函数
3.1 什么是魔法函数
3.2 python 数据模型
3.3 魔法函数一览
3.4 len 函数的特殊性
3.5 本章小结
第四章:深入类和对象
第五章:自定义序列类
第六章:深入Python的set和dict
第七章:对象引用、可变性和垃圾回收
第八章:元类编程
第九章:迭代器和生成器
关于作者
Roadmap
AdvancePython
Docs
»
第三章:魔法函数
»
3.5 本章小结
Edit on GitHub
3.5 本章小结
¶
什么是魔法函数,如何增加类型的特性
不需要显示调用魔法函数,内置函数或相应python语法时会自动触发魔法函数
通过魔法函数去理解 python 类型
len 内部有优化
Read the Docs
v: latest
Versions
latest
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds
Free document hosting provided by
Read the Docs
.