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: Add reduce to functools in 2.6
Type: Stage:
Components: Library (Lib) Versions: Python 2.6
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, gvanrossum
Priority: normal Keywords: patch

Created on 2007-06-19 19:10 by christian.heimes, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg52791 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-06-19 19:10
I'm proposing to add reduce to functools to make code forward compatible with 3.0 code. Since 2to3 has no fixer for reduce it's an easy way to make code run under 2.6 and 3.0 w/o a try/except ImportError block.

Index: Lib/functools.py
===================================================================
--- Lib/functools.py    (revision 56041)
+++ Lib/functools.py    (working copy)
@@ -8,6 +8,7 @@
 # See C source code for _functools credits/copyright
 
 from _functools import partial
+from __builtin__ import reduce
 
 # update_wrapper() and wraps() are tools to help write
 # wrapper functions that can handle naive introspection
msg55340 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-08-27 20:51
Committed revision 57574.
History
Date User Action Args
2022-04-11 14:56:25adminsetgithub: 45115
2007-08-27 20:51:14gvanrossumsetstatus: open -> closed
resolution: accepted
messages: + msg55340
nosy: + gvanrossum
2007-06-19 19:10:46christian.heimescreate