Little problem with the "+" operator

Fredrik Aronsson d98aron at
Mon Mar 5 21:36:12 CET 2001

In article <mt1yscm7yu.fsf at>,
	Johann Hibschman <johann at> writes:
> Joshua Marshall writes:
>>> This is infinitely more sane than:
>>> % perl -e 'print 500 + "cool"'
>>> 500
>> Comparing Python to Perl here doesn't seem very fair.  They're very
>> different languages.  In general, I'm surprised by the urgency with
>> which people often jump to compare them.
> Well, Perl's the only language that I know of that lets you add 500 to
> "cool" without an error.  Well, I suppose tcl might.  But it's still a
> fairly safe inference that the original poster was coming from Perl.

Well, my first guess was Java.

public class Test {
    public static void main(String[] args) {
	int variableOne = 500;
	String myVariable = variableOne + "cool";

gere(1)> javac 
gere(2)> java Test

Since I havn't found a % operator or a printf function, I like it.


(Well, I have gotten to like Haskell a lot more after learning Java,
wrote a complete parser+typechecker for a little language,
211 lines in Haskell
~2400 lines in Java (and I'm not counting the generated code.))

More information about the Python-list mailing list