Operator overloading is the interception of built-in operations in a method (a special method of double underlines)--when an instance of the class appears in a built-in operation, Python automatically calls the custom method and returns the result of the action of the custom method.
You can have the class intercept regular Python operations.
Callable object: __call__ ()
Functions: Built-in functions, custom functions, Def, Lambda
Class
Class method
Properties of the function:
__doc__
__name__
__dict__
__code__
__globals__
Properties of the method:
__doc__
__name__
__func__
__class__
__self__
Properties of built-in functions:
__doc__
__name__
__self__
Class:
__doc__
__name__
__bases__
__dict__
__MODULE__: Defines the module name of the current class
Instance:
__class__
__dict__
Objects have special methods:
__init__,__new__,__del__
__DIR__ () __add__ () __ge__ ()
A >= b A. __GE__ (b)
Python operator overloading