Booleans, integer division, backwards compatibility; where is Python going?

Aahz aahz at pythoncraft.com
Fri Apr 5 12:18:42 EST 2002


In article <slrnaapc23.r7n.philh at comuno.freeserve.co.uk>,
phil hunt <philh at comuno.freeserve.co.uk> wrote:
>
>Recently on this newsgroup there's been a discussion about adding a 
>bool datatype to Python; and Guido has decided to do this.
>
>Some time ago, there was a rather contentious discussion about 
>changing the semantics of the / operator. To be precise, what should 
>it do when the arguments are integers: should 1/2 be 0 or 0.5?
>
>In both cases, there are good arguments in favour of the change. 
>(Though having said that, in both cases Python has done perfectly 
>well for years without it). The problem with making these changes is 
>that they can cause currently-working Python code to fail on new 
>versions of the language.

Note that in the case of division, the incompatible change has been
officially postponed to Python 3.0.  In both cases, the argument is that
Python has *not* worked "perfectly well"; both cases in current Python
generate ambiguities of the sort that Guido loathes.

Whether the removal of those ambiguities is worth the pain of change is
something that Guido has to rule on.  I'm a little disappointed that the
division case took so much heat before Guido modified things
sufficiently to handle the problems pointed out, but at this point, I
feel confident that the end product was at least not-bad decisions, even
if I am not wholly convinced that they were good decisions.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"There are times when effort is important and necessary, but this should
not be taken as any kind of moral imperative."  --jdecker



More information about the Python-list mailing list