【发布时间】:2015-12-04 17:30:20
【问题描述】:
例如,在 Python 中使用 __eq__ 是否与在 C++ 中使用 operator== 相同?魔术方法在 Python 中还有其他功能吗?
【问题讨论】:
-
有很多dunder方法与运算符重载无关:
__str__、__len__、__iter__、__hash__。
标签: python c++ operator-overloading magic-methods