for / while else doesn't make sense

Jon Ribbens jon+usenet at unequivocal.co.uk
Fri May 20 20:35:48 EDT 2016


On 2016-05-20, Steven D'Aprano <steve at pearwood.info> wrote:
> By that logic, we ought to:
>
> - avoid using floats because their behaviour isn't intuitive and
>   can be confusing;

To be fair, I'm very sympathetic to that argument. I think programming
languages should never magically produce floats out of nowhere unless
the programmer has explicitly done "import float" or "float('3.23')"
or somesuch. They're misunderstood so often that any convenience
they provide is outweighed by the danger they bring.

"(1/10) * (1/10) * 10 != (1/10)" anyone? I was distinctly unhappy with
the Python 3 "2/3 ~= 0.6666" thing and regard it as a very retrograde
change.



More information about the Python-list mailing list