Message76688
On Mon, Dec 1, 2008 at 7:15 AM, Mark Dickinson <report@bugs.python.org> wrote:
> Well, there are precedents:
>
>>>> type(2**3)
> <type 'int'>
>>>> type(2**-3)
> <type 'float'>
>
> My initial reaction to this was negative, but I'm struggling to think of
> situations where it would be bad. I'm also struggling to think of
> situations where it would be useful. Maybe Monday morning is just a
> bad time for thinking. :-)
>
> Might be worth a discussion on python-ideas, at least?
I don't know about the internal representations in python, but I
believe ints can be larger than ints. Nevertheless your example there
which would have drove me nuts if I found it :-). I like the true
division feature, but I find it too far deviant, if all of a sudden
code started producing floats instead of ints, on a given upgrade of
python someday soon.
I think the result should be int if it is an int, but float if and
only if it is really needed.
I think your right, this conversation should probably move to python
ideas, since this was by design and not a bug. (but I do not really
like this part of the "feature"). |
|
Date |
User |
Action |
Args |
2008-12-01 11:43:04 | nassrat | set | recipients:
+ nassrat, mark.dickinson, pitrou |
2008-12-01 11:43:03 | nassrat | link | issue4479 messages |
2008-12-01 11:43:02 | nassrat | create | |
|