Comparison of strings and integer
Franz GEIGER
fgeiger at datec.at
Tue Jul 25 12:36:17 EDT 2000
Still not very experienced in programming Python I recently compared
accidentially a string variable with an integer variable. Python did it his
way, which was not my way: I expected a conversion like Perl does or a
runtime error like REBOL does. Is there any way to prevent Python from doing
so?
Python: print "1" > 1 --> 1
Perl: print not ("1" > 1); --> 1
REBOL: print "1" > 1 -->
** Script Error: Expected one of: string! - not: integer!.
** Where: print "1" > 1
Many thanks in advance and best regards
Franz GEIGER
More information about the Python-list
mailing list