for / while else doesn't make sense

Marko Rauhamaa marko at pacujo.net
Sun May 22 10:58:24 EDT 2016


Jon Ribbens <jon+usenet at unequivocal.co.uk>:

> On 2016-05-21, Chris Angelico <rosuav at gmail.com> wrote:
>> The trouble is, what SHOULD 2/3 return?
>
> [...]
>
> Yes, it should return an integer - and not because I think Python
> should behave like C on principle, but because:
>
>         Explicit is better than implicit.
>         Simple is better than complex.
>         Complex is better than complicated.
>
> and floats are complicated.

Scheme has the best of both worlds:

   scheme@(guile-user)> 2/3
   $1 = 2/3
   scheme@(guile-user)> (exact->inexact $1)
   $2 = 0.6666666666666666

> That's a trap for those people though - it lulls them into thinking
> that they understand what's going on, when in fact they don't, because
> they don't understand floats, because almost nobody understands
> floats. So they don't understand their program, and - even worse -
> they don't know that they don't understand it.

I don't understand this rant. Numeric programming is one of the oldest
uses for computers. Rounding errors have been there since the beginning.
If you think people have a hard time getting floats, integers are at
least as hard to get. How about classes, closures, threads, asyncio...?

Python ought to be the perfect language for seasoned experts. It doesn't
need to be dumbed down for noobs.


Marko



More information about the Python-list mailing list