[Python-Dev] Rationale for sum()'s design? (original) (raw)
Alex Martelli aleaxit at yahoo.com
Mon Mar 14 13:12:59 CET 2005
- Previous message: [Python-Dev] Rationale for sum()'s design?
- Next message: [Python-Dev] Rationale for sum()'s design?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Mar 14, 2005, at 11:20, Nick Coghlan wrote: ...
Somewhat ugly, but backwards compatible:
I realize you're mostly talking semantics, not implementation, but, as long as we're at it, could we pretty please have back the optimization indicated by...:
# Add the elements
if isinstance(value, basestring):
return value + ''.join(itr)for item in itr: value += item return value
...? This doesn't break bw compat since currently when value's a string sum would raise an exception...
Alex
- Previous message: [Python-Dev] Rationale for sum()'s design?
- Next message: [Python-Dev] Rationale for sum()'s design?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]