[Python-3000] Python 3000 Status Update (Long!)
Nick Coghlan
ncoghlan at gmail.com
Thu Jun 21 15:45:20 CEST 2007
Gareth McCaughan wrote:
> That is: if you're writing code that expects sum() to do something
> sensible with lists of strings, you'll usually need it to do something
> sensible with *empty* lists of strings -- but that isn't possible,
> because there's only one empty list and it has to serve as the empty
> list of integers too.
That is indeed the reason for the explicit start value - sum() needs to
know what to return when the supplied iterable is empty.
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
---------------------------------------------------------------
http://www.boredomandlaziness.org
More information about the Python-3000
mailing list