-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sum([]) vs reduce(+,[]) #6554
Comments
I would tend to argue for the reverse. Having Maybe |
It seems like a good idea to get rid of |
Also, |
In the help,
sum(x)
is described as a "more convenient" notation forreduce(+,x)
. There is, however a use case when the two are not equivalent:The same goes for
prod
, but forany
the behavior is invertedI suggest that
sum([])
andprod([])
should return0
and1
respectively, just to conform with+() => 0
and*() => 1
. I don't know what to do withany
.The text was updated successfully, but these errors were encountered: