[issue7203] fixer for map(None, ...) needs to consider multi-argument case

2009-10-27 Thread Florian Mayer

Florian Mayer  added the comment:

When could this possibly be wrong, if I may ask?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7203] fixer for map(None, ...) needs to consider multi-argument case

2009-10-27 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

2009/10/27 Florian Mayer :
>
> Florian Mayer  added the comment:
>
> At least converting
>
> map(None, a, b, ...)
>
> to
>
> map(lambda *xs: xs, a, b, ...)

Well, since that's not always correct, we should not translate to it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7203] fixer for map(None, ...) needs to consider multi-argument case

2009-10-27 Thread Florian Mayer

Florian Mayer  added the comment:

At least converting

map(None, a, b, ...)

to

map(lambda *xs: xs, a, b, ...)

I can understand if you prefer not to add the itertools.zip_longest
workaround, although that would be the correct translation, of course.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7203] fixer for map(None, ...) needs to consider multi-argument case

2009-10-27 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

2009/10/27 Florian Mayer :
>
> Florian Mayer  added the comment:
>
> I dare to disagree on this being an adequate fix. Request to reopen.

What would you prefer?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7203] fixer for map(None, ...) needs to consider multi-argument case

2009-10-27 Thread Florian Mayer

Florian Mayer  added the comment:

I dare to disagree on this being an adequate fix. Request to reopen.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7203] fixer for map(None, ...) needs to consider multi-argument case

2009-10-26 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Fixed in r75734.

--
nosy: +benjamin.peterson
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7203] fixer for map(None, ...) needs to consider multi-argument case

2009-10-25 Thread Florian Mayer

Florian Mayer  added the comment:

A full fix would be

list(map(fun, *zip(*itertools.zip_longest(a, b, ...

and if fun is None

list(map(lambda *xs: xs, *zip(*itertools.zip_longest(a, b, ...

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7203] fixer for map(None, ...) needs to consider multi-argument case

2009-10-25 Thread Florian Mayer

Changes by Florian Mayer :


--
nosy: +segfaulthunter

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7203] fixer for map(None, ...) needs to consider multi-argument case

2009-10-25 Thread Georg Brandl

New submission from Georg Brandl :

Currently, ``map(None, a)`` is recognized and converted to ``list(a)``
which is correct but quite useless.

``map(None, a, b, ...)`` is not treated specially.  An approximate
translation would be ``map(lambda *xs: xs, a, b, ...)`` which however
doesn't take into account that the new map cuts after the shortest
sequence instead of "filling up" the shorter ones with Nones.

That should probably produce a warning.

--
components: 2to3 (2.x to 3.0 conversion tool)
messages: 94455
nosy: georg.brandl
priority: high
severity: normal
stage: needs patch
status: open
title: fixer for map(None, ...) needs to consider multi-argument case
type: behavior
versions: Python 3.1, Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com