python运算符重载
摘要:
python运算符重载就是在解释器使用对象内置操作前,拦截该操作,使用自己写的重载方法。 重载方法:__init__为构造函数,__sub__为减法表达式 其他重要的还有(省去前后的__): del析构函数, add加法表达式, or, repr打印(print), str转化(str), call 阅读全文
posted @ 2016-12-13 17:50 LebronZhang 阅读(182) 评论(0) 推荐(0)
浙公网安备 33010602011771号