On Thu, Jun 21, 2007 at 02:49:46AM -0700, Steve Howell wrote: > > "Sum" should sum stuff. You can't sum strings. It makes no sense in > English.
I think you're technically right, but I frequently find myself using the phrase "add together a list of strings" when it would be more accurate to say "concatenate a list of strings." I can't say I feel bad when I use this terminology. > Multiple additions (with "+") mean "sum" in arithmetic, but you can't > generalize that to strings and text processing. The "+" operator for > any two strings is not about adding--it's about joining/concatenating. > So multiple applications of "+" on strings aren't a sum. They're just > a longer join/concatenation. I guess I don't find the distinction between adding and concatenating as strong as you do. When we write 'a' + 'b', I don't see any problem with saying that we're adding 'a' and 'b', and I don't think there's anything unclear about sum(['a', 'b', 'c']). -- Andrew McNabb http://www.mcnabbs.org/andrew/ PGP Fingerprint: 8A17 B57C 6879 1863 DE55 8012 AB4D 6098 8826 6868
signature.asc
Description: Digital signature
_______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com