Open dzhang314 opened 9 years ago
Currently, adding a string to a number (in either order) casts the number to a string and concatenates:
"abc" + 123 == "abc123" 123 + "abc" == "123abc"
Both should throw a TypeError.
TypeError
On a related note, sum() shouldn't work on lists of strings. Currently, sum(["a", "b", "c"]) produces "0abc".
sum()
sum(["a", "b", "c"])
"0abc"
Currently, adding a string to a number (in either order) casts the number to a string and concatenates:
Both should throw a
TypeError
.