[issue3474] Using functools.reduce() does not stop DeprecationWarning when using -3

2008-08-17 Thread Brett Cannon

Brett Cannon [EMAIL PROTECTED] added the comment:

Reviewing the patch at http://codereview.appspot.com/2968 .

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3474
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3474] Using functools.reduce() does not stop DeprecationWarning when using -3

2008-08-17 Thread Brett Cannon

Brett Cannon [EMAIL PROTECTED] added the comment:

Reviewed in Rietveld. Only a minor change is suggested. Otherwise I
think the patch is ready to be committed, Benjamin.

--
assignee: brett.cannon - benjamin.peterson

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3474
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3474] Using functools.reduce() does not stop DeprecationWarning when using -3

2008-08-17 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

Thanks for the review! Committed in r65802.

--
resolution:  - fixed
status: open - closed

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3474
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3474] Using functools.reduce() does not stop DeprecationWarning when using -3

2008-08-15 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

Here's a patch that actually imports reduce from functools to stop
repetition.

--
keywords: +patch
priority: release blocker - high
Added file: http://bugs.python.org/file11120/import_from_functools.diff

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3474
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3474] Using functools.reduce() does not stop DeprecationWarning when using -3

2008-08-02 Thread Brett Cannon

Changes by Brett Cannon [EMAIL PROTECTED]:


--
priority: critical - release blocker

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3474
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3474] Using functools.reduce() does not stop DeprecationWarning when using -3

2008-07-31 Thread Raymond Hettinger

Raymond Hettinger [EMAIL PROTECTED] added the comment:

Can't this be handled by 2-to-3 instead of a -3 warning?

--
components: +2to3 (2.x to 3.0 conversion tool) -Library (Lib)
nosy: +rhettinger

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3474
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3474] Using functools.reduce() does not stop DeprecationWarning when using -3

2008-07-31 Thread Brett Cannon

Brett Cannon [EMAIL PROTECTED] added the comment:

On Wed, Jul 30, 2008 at 11:32 PM, Raymond Hettinger
[EMAIL PROTECTED] wrote:

 Raymond Hettinger [EMAIL PROTECTED] added the comment:

 Can't this be handled by 2-to-3 instead of a -3 warning?


Well, there is the problem of someone having a function already named
reduce() and the import. Since 2to3 can't go back and add an import,
every found use of reduce() would need to have an import inserted
somewhere. That won't work if reduce() is being used in a expression
context instead of a statement context, etc.

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3474
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3474] Using functools.reduce() does not stop DeprecationWarning when using -3

2008-07-31 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

Alternatively, you could move reduce to functools and have the builtin
module issue a warning and call it.

--
nosy: +benjamin.peterson

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3474
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3474] Using functools.reduce() does not stop DeprecationWarning when using -3

2008-07-31 Thread Brett Cannon

Brett Cannon [EMAIL PROTECTED] added the comment:

On Thu, Jul 31, 2008 at 11:56 AM, Benjamin Peterson
[EMAIL PROTECTED] wrote:

 Benjamin Peterson [EMAIL PROTECTED] added the comment:

 Alternatively, you could move reduce to functools and have the builtin
 module issue a warning and call it.


That's what 3.0 did; created _functools and that holds the original
implementation from __builtins__. But that is a lot more work. =)

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3474
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3474] Using functools.reduce() does not stop DeprecationWarning when using -3

2008-07-30 Thread Brett Cannon

New submission from Brett Cannon [EMAIL PROTECTED]:

It turns out that functools.reduce() is simply __builtins__.reduce().
That does not stop the DeprecationWarning from using reduce() from being
raised even though the message says to use functools.reduce()!

Easiest solution is to create a wrapper for __builtin__.reduce() that
silences the warning when called.

--
assignee: brett.cannon
components: Library (Lib)
messages: 70484
nosy: brett.cannon
priority: critical
severity: normal
status: open
title: Using functools.reduce() does not stop DeprecationWarning when using -3
type: behavior
versions: Python 2.6

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3474
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com