标签: python operator-overloading
我在Python中要求,当我做这种代码时
class B(): pass A = B # not really assign value, but to invoke a function to do some work.
我想在分配“A = B”时调用其他函数,所以我想到运算符重载,我找到了一个链接:
http://thepythonguru.com/python-operator-overloading/
但似乎我们不能重载运算符“=”,有没有解决方法?