[Python-3000] Python 3000 Status Update (Long!)
Andrew McNabb
amcnabb at mcnabbs.org
Thu Jun 21 17:45:01 CEST 2007
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.python.org/pipermail/python-3000/attachments/20070621/c0366fe4/attachment.pgp
More information about the Python-3000
mailing list