Question: 3.4.1 About rmul_ etc When you write e.g. a b in Python, this is executed as a. mul(b). In our case, a might be an

 3.4.1 About rmul_ etc When you write e.g. a b in

3.4.1 About rmul_ etc When you write e.g. a b in Python, this is executed as a. mul(b). In our case, a might be an integer, and b might be an instance of our Complex class. This will give us trouble, because int's .mulmethod does not know how to work with instances of Complex. What python will do instead, is trying to execute b. rmul(a) instead. We don't execute b._mul(a), becuase we might have a case where a bba Name of file: complex.py, test.complex.py 3.4.1 About rmul_ etc When you write e.g. a b in Python, this is executed as a. mul(b). In our case, a might be an integer, and b might be an instance of our Complex class. This will give us trouble, because int's .mulmethod does not know how to work with instances of Complex. What python will do instead, is trying to execute b. rmul(a) instead. We don't execute b._mul(a), becuase we might have a case where a bba Name of file: complex.py, test.complex.py

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!