Why does calling Python's 'magic method' not do type conversion like it would for the corresponding operator?
Why does calling Python's 'magic method' not do type conversion like it would for the corresponding operator? Question: When I subtract a float from an integer (e.g. 1-2.0), Python does implicit type conversion (I think). But when I call what I thought was the same operation using the magic method __sub__, it suddenly does not …
Total answers: 2