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

phil hunt philh at comuno.freeserve.co.uk
Sat Apr 6 12:39:38 EST 2002


On 5 Apr 2002 12:18:42 -0500, Aahz <aahz at pythoncraft.com> wrote:
>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.

What ambiguities? There is nothing ambiguous about current behavour 
of truth values. Furthermore, there is nothing that, in practise, 
hampers programmers: a programmer can easily learn to use 1 and 0 
for true and false.

The only advantage for the new scheme, as I see it, is it looks 
prettier and is a bit easier for newbies. Ditto for integer 
division.


-- 
<"><"><"> Philip Hunt <philh at comuno.freeserve.co.uk> <"><"><">
"I would guess that he really believes whatever is politically 
advantageous for him to believe." 
                        -- Alison Brooks, referring to Michael
                              Portillo, on soc.history.what-if



More information about the Python-list mailing list