[Tutor] More type() puzzlement
rdm at rcblue.com
Sun Oct 28 02:14:48 CEST 2007
At 04:06 PM 10/27/2007, Alan Gauld wrote:
>"Dick Moores" <rdm at rcblue.com> wrote
> >> Hence if type(n) is already long it does not have to get converted
> >> to int to accommodate something small.
> > And that's not a bug?
>No its expected behaviour.
>If you start with a float and add an integer the result is a float.
>Why should long act any different?
> >>> n = 4.0
> >>> n + 2
So you're saying that it's to be expected that the analogy, "int is
to long as int is to float" will hold. But why should it be expected
to hold? float and long are completely different animals, no?
More information about the Tutor