Computer >> Hướng Dẫn Máy Tính >  >> Lập Trình >> Python

Giải thích Python Operator Overloading

Mọi class Python kế thừa từ object. Class object có các magic methods (__lt__, __gt__, __eq__, __ne__...). Override các method này để overload operator <, >, ==, !=...