Opened 8 years ago

Closed 8 years ago

#4066 enhancement closed fixed (fixed)

`reduce` for Python 3.x

Reported by: Carlos Valiente Owned by:
Priority: normal Milestone:
Component: core Keywords: py3k
Cc: Branch: branches/reduce-4066-2
branch-diff, diff-cov, branch-cov, buildbot
Author: exarkun, cvaliente

Description

This patch eliminates the DeprecationWarning for "reduce() not supported in 3.x; use functools.reduce()"

Attachments (1)

reduce.diff (4.4 KB) - added by Carlos Valiente 8 years ago.

Download all attachments as: .zip

Change History (10)

Changed 8 years ago by Carlos Valiente

Attachment: reduce.diff added

comment:1 Changed 8 years ago by Jean-Paul Calderone

Keywords: review added

comment:2 Changed 8 years ago by Jean-Paul Calderone

Author: exarkun
Branch: branches/reduce-4066

(In [27486]) Branching to 'reduce-4066'

comment:3 Changed 8 years ago by Jean-Paul Calderone

Author: exarkuncvaliente, exarkun

Seems generally to be the right idea. I think we can dump reduce into twisted.python.compat though, and remove some of the uses of reduce. I put the patch in the branch and made those changes, plus updated some copyright dates.

comment:4 Changed 8 years ago by Jean-Paul Calderone

Author: cvaliente, exarkunexarkun, cvaliente
Branch: branches/reduce-4066branches/reduce-4066-2

(In [27492]) Branching to 'reduce-4066-2'

comment:5 Changed 8 years ago by Jean-Paul Calderone

Okay, I did like I said, someone else should take a look at this now.

comment:6 Changed 8 years ago by Jean-Paul Calderone

Owner: Glyph deleted

comment:7 Changed 8 years ago by radix

Keywords: review removed
Owner: set to Jean-Paul Calderone

Looks good, please merge.

comment:8 Changed 8 years ago by Jean-Paul Calderone

Resolution: fixed
Status: newclosed

(In [27667]) Merge reduce-4066-2

Author: exarkun, cvaliente Reviewer: radix Fixes: #4066

Try to use functools.reduce when it is available, instead of the builtin reduce, which is removed in Python 3.x.

comment:9 Changed 7 years ago by <automation>

Owner: Jean-Paul Calderone deleted
Note: See TracTickets for help on using tickets.