Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

reduce() used to be in the builtins in python 2.x. It was removed due to low usage. Keeping the builtins list tiny is a core principle of the language.


Guido van Rossum on reduce:

> So now reduce(). This is actually the one I've always hated most, because, apart from a few examples involving + or *, almost every time I see a reduce() call with a non-trivial function argument, I need to grab pen and paper to diagram what's actually being fed into that function before I understand what the reduce() is supposed to do. So in my mind, the applicability of reduce() is pretty much limited to associative operators, and in all other cases it's better to write out the accumulation loop explicitly.

https://www.artima.com/weblogs/viewpost.jsp?thread=98196


Probably low usage because it sort of relies on lambdas (not exactly, you can define one-off functions, but most people don’t like to) and python lambdas are terrible.


Low usage because Python makes it annoying to use…


You mean, breaking users is the principle of the language.


Your post doesn't mean anything; but even the most charitable meaning I can assign to it is pretty bad.

Stuff like this is no better than "php bad!!1".




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: