[Python-Dev] Integer division transition

Peter Funk pf@artcom-gmbh.de
Tue, 7 Nov 2000 15:59:01 +0100 (MET)


Hi,

Guido van Rossum:
> No, we *could* use the 'import as' trick: define the syntax as
> 
> term: factor (('*'|'/'|'%'|NAME) factor)*
> 
> and add a check that NAME is "div" in the compiler.
> 
> But I don't know how comfy I am with a proliferation of hacks like
> this -- and it's likely to cause more confusing error messages.

In Modula-2 it is forbidden to declare a variable or procedure called
'DIV' or 'MOD', since both were reserved words in this language from
the very beginning.  But in Python the situation is different and
people might have used 'div' as an identifier.  So unless Guido is
able to fix this using the famous time machine ...sigh... for the
sake of backward compatibility using this "hack" seems to be the best
available choice.

I believe confusing error messages can be avoided and I see no 
"proliferation of hacks" in this two attempts to avoid defining
new keywords.  Keeping backward compatibility always had its price.
But it is often a price worth to pay.

Just my $0.02, Peter
-- 
Peter Funk, Oldenburger Str.86, D-27777 Ganderkesee, Germany, Fax:+49 4222950260
office: +49 421 20419-0 (ArtCom GmbH, Grazer Str.8, D-28359 Bremen)