for / while else doesn't make sense

Jon Ribbens jon+usenet at unequivocal.co.uk
Mon May 23 13:57:30 EDT 2016


On 2016-05-23, Chris Angelico <rosuav at gmail.com> wrote:
> On Tue, May 24, 2016 at 3:09 AM, Jon Ribbens
><jon+usenet at unequivocal.co.uk> wrote:
>> On 2016-05-23, Steven D'Aprano <steve at pearwood.info> wrote:
>>> But one thing is certain: very few people, Jon Ribbens being one of them,
>>> expects 1/3 to return 0. And that is why Python changed the meaning of
>>> the / operator: because using it for integer division was deeply unpopular
>>> and a bug magnet.
>>
>> Making it return floats is also a bug magnet, just for more subtle
>> bugs that are harder to diagnose.
>
> See my earlier post. There are four broadly-viable options: int,
> float, Fraction, Decimal. *Every one of them* is a bug magnet in one
> way or another. Which kind of bug would you like?

The simplest one - isn't that obvious from what I've already said? 



More information about the Python-list mailing list