PEP0238 lament

Duncan Booth duncan at NOSPAMrcp.co.uk
Wed Jul 25 10:26:37 EDT 2001


Guido van Rossum <guido at python.org> wrote in news:cpofqaova7.fsf at cj20424-
a.reston1.va.home.com:

> If you agree that, if it weren't for breaking old code, PEP-238 would
> make Python a better language, what can we do about that old code?
> 

I agree that it would make Python a different language. Neither better nor 
worse.

You arguably gain in meeting some peoples expectations of the division 
operator, but you lose consistency in that previously (as far I can think), 
the operators +, -, *, /, % when given two arguments of the same numeric 
type always return a result of that same type. In future we have to be 
prepared to explain to beginners that division can give a result of a 
different type: in fact you cannot even predict the type of the result when 
you know the types of the arguments, you have to know their values as well.

-- 
Duncan Booth                                             duncan at rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?



More information about the Python-list mailing list