Skip to content
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

Add reduce to functools in 2.6 #45115

Closed
tiran opened this issue Jun 19, 2007 · 2 comments
Closed

Add reduce to functools in 2.6 #45115

tiran opened this issue Jun 19, 2007 · 2 comments
Labels
stdlib Python modules in the Lib dir

Comments

@tiran
Copy link
Member

tiran commented Jun 19, 2007

BPO 1739906
Nosy @gvanrossum, @tiran

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2007-08-27.20:51:14.033>
created_at = <Date 2007-06-19.19:10:46.000>
labels = ['library']
title = 'Add reduce to functools in 2.6'
updated_at = <Date 2007-08-27.20:51:14.031>
user = 'https://github.com/tiran'

bugs.python.org fields:

activity = <Date 2007-08-27.20:51:14.031>
actor = 'gvanrossum'
assignee = 'none'
closed = True
closed_date = <Date 2007-08-27.20:51:14.033>
closer = 'gvanrossum'
components = ['Library (Lib)']
creation = <Date 2007-06-19.19:10:46.000>
creator = 'christian.heimes'
dependencies = []
files = []
hgrepos = []
issue_num = 1739906
keywords = ['patch']
message_count = 2.0
messages = ['52791', '55340']
nosy_count = 2.0
nosy_names = ['gvanrossum', 'christian.heimes']
pr_nums = []
priority = 'normal'
resolution = 'accepted'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1739906'
versions = ['Python 2.6']

@tiran
Copy link
Member Author

tiran commented Jun 19, 2007

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

@tiran tiran added stdlib Python modules in the Lib dir labels Jun 19, 2007
@gvanrossum
Copy link
Member

Committed revision 57574.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir
Projects
None yet
Development

No branches or pull requests

2 participants