Jan-24-2023, 08:22 AM
(Jan-23-2023, 04:50 PM)deanhystad Wrote: Not great examples. I see why it was demoted from builtins and exiled to functools.
After built-in sum was added main value of reduce was... reduced :-).
From About Guido’s Article: “Fate of Reduce() in Python 3000”
Quote:Guido: “I value readability and usefulness for real code. There are some places where map() and filter() make sense, and for other places Python has list comprehensions. I ended up hating reduce() because it was almost exclusively used (a) to implement sum(), or (b) to write unreadable code. So we added built-in sum() at the same time we demoted reduce() from a built-in to something in functools (which is a dumping ground for stuff I don’t really care about :-).”
And Guidos original article: The fate of reduce() in Python 3000
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.