Domanda di colloquio di DuPont

What is operator overloading in python?

Risposta di colloquio

Anonimo

21 mar 2017

The operators are actually methods defined in respective classes. Defining methods for operators is known as operator overloading. For e.g. To use + operator with custom objects you need to define a method called __add__ .