S
Steven D'Aprano
Automatic conversions, okay... but converting a result when all
inputs are of one time, NO...
What? How does that make any sense?
By that logic, we should see this:
{1: None}len("a string") '8'
len([2, 4, 6]) [3]
len({'key': 'value'})
The only rule needed is very simple: promote simpler types to the
more complex type involved in the current expression (with expression
defined as "value operator value" -- so (1/2) * 3.0 is INTEGER 1/2,
resultant 0 then promoted to float 0.0 to be compatible with 3.0).
Very simple rule, used by very many traditional programming
languages.
And rightly rejected by many other programming languages, including
modern Python, not to mention calculators, real mathematics and common
sense.