[Python-3000] a plea : invalid comparisons should raise an exception
Helmut Jarausch
jarausch at igpm.rwth-aachen.de
Mon Apr 23 18:30:57 CEST 2007
Some years ago, I was allured to convert from Perl to Python.
The main argument was that Python is much more secure.
That turned out to be true with one big exception.
The following lines would run just fine (as equivalent
Perl code)
from cStringIO import StringIO
Inp= StringIO('Guido 10')
for line in Inp:
(Name,Age)= line.split()
if Age > 64 :
print Name,"has retired"
But with Python it returns a very unexpected result
without any evidence of a problem.
So, please make comparisons raise an exception (at least
optionally) if "uncompatible" types are compared.
--
Helmut Jarausch
Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany
More information about the Python-3000
mailing list