Re: How about adding rational fraction to Python?
On Feb 28, 9:36 am, Grant Edwards <gra...@visi.co mwrote:
2 goes into 1 0.5 times.
>
By that logic, there's no reason for 1 + "two" shouldn't
convert one operand or the other.
False dilemma, chief. That preserving type is not self-evident
doesn't make all operations that don't preserve type a good idea.
>
It seems to me that the expectation that 1/2 yield 0.5 is just
as much a convention as that it yield 0 or a true rational.
Sure it is, but unlike the old convention, it's the obvious one.
Carl Banks
On Feb 28, 9:36 am, Grant Edwards <gra...@visi.co mwrote:
On 2008-02-28, Carl Banks <pavlovevide... @gmail.comwrote :
>
>
>
>
I guess obviousness is in the eye of the beholder. To me it's
obvious that "1" and "2" are integers, and it's also obvious
that 2 goes into 1 zero times.
>
Automatic conversions, okay... but converting a result when
all inputs are of one time, NO...
all inputs are of one time, NO...
People, this is so cognitive dissonance it's not even funny.
There is absolutely nothing obvious about 1/2 returning a number that
isn't at least approximately equal to one half.
isn't at least approximately equal to one half.
I guess obviousness is in the eye of the beholder. To me it's
obvious that "1" and "2" are integers, and it's also obvious
that 2 goes into 1 zero times.
There is nothing self-evident about operations maintaining
types.
types.
By that logic, there's no reason for 1 + "two" shouldn't
convert one operand or the other.
doesn't make all operations that don't preserve type a good idea.
You people can't tell the difference between "obvious" and "learned
conventions that came about because in limitations in the hardware at
the time".
conventions that came about because in limitations in the hardware at
the time".
It seems to me that the expectation that 1/2 yield 0.5 is just
as much a convention as that it yield 0 or a true rational.
Carl Banks
Comment