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

Brett Cannon report at bugs.python.org
Thu Jul 31 19:43:59 CEST 2008


Brett Cannon <brett at python.org> added the comment:

On Wed, Jul 30, 2008 at 11:32 PM, Raymond Hettinger
<report at bugs.python.org> wrote:
>
> Raymond Hettinger <rhettinger at users.sourceforge.net> 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 <report at bugs.python.org>
<http://bugs.python.org/issue3474>
_______________________________________


More information about the Python-bugs-list mailing list