This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Remove reduce()
Type: Stage:
Components: Interpreter Core Versions: Python 3.0
process
Status: closed Resolution: later
Dependencies: Superseder:
Assigned To: Nosy List: brett.cannon, collinwinter, jimjjewett
Priority: normal Keywords: patch

Created on 2006-06-27 10:20 by collinwinter, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
py3k-remove_reduce.patch collinwinter, 2006-06-27 10:20 Remove reduce(), against r47103
Messages (7)
msg50535 - (view) Author: Collin Winter (collinwinter) * (Python committer) Date: 2006-06-27 10:20
This patch removes the built-in reduce() function,
including its documentation and tests.

This patch is against r47103.
msg50536 - (view) Author: Jim Jewett (jimjjewett) Date: 2006-06-27 15:19
Logged In: YES 
user_id=764593

This recreates a reduce in csv.  Wouldn't it make more 
sense to move reduce to functools, and import it from there?
msg50537 - (view) Author: Collin Winter (collinwinter) * (Python committer) Date: 2006-06-27 15:20
Logged In: YES 
user_id=1344176

Would you like to see map, filter, reduce all moved to
functools?
msg50538 - (view) Author: Jim Jewett (jimjjewett) Date: 2006-06-27 15:24
Logged In: YES 
user_id=764593

If the difflib change, couldn't

+        matches = 0
+        for triple in self.get_matching_blocks():
+            matches += triple[-1]

be further simplified to

matches=sum(triple[-1] for triple in 
self.get_matching_blocks())
msg50539 - (view) Author: Collin Winter (collinwinter) * (Python committer) Date: 2006-06-27 15:42
Logged In: YES 
user_id=1344176

I've changed my local version to improve the difflib change,
per Jim's suggestion. I'm working on a combined patch that
will remove reduce, filter and map all in one go, so I'm
going to close this one.
msg50540 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2006-06-27 15:51
Logged In: YES 
user_id=357491

Just to answer your question about map and filter, Collin:
just rip them out.  Generator comprehensions take care of
both cases.  reduce() is the only thing worth moving to
functools.
msg50541 - (view) Author: Collin Winter (collinwinter) * (Python committer) Date: 2006-06-28 09:43
Logged In: YES 
user_id=1344176

This patch has been superseded by path #1513870.
History
Date User Action Args
2022-04-11 14:56:18adminsetgithub: 43560
2008-01-06 22:29:46adminsetkeywords: - py3k
versions: + Python 3.0
2006-06-27 10:20:25collinwintercreate