classification
Title: Clean up usage of map() in the stdlib
Type: enhancement Stage: patch review
Components: Library (Lib) Versions: Python 3.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: anthonybaxter, collinwinter, eric.araujo, georg.brandl, grubert, jimjjewett
Priority: normal Keywords: patch

Created on 2006-06-27 12:15 by collinwinter, last changed 2010-12-04 10:39 by georg.brandl. This issue is now closed.

Files
File name Uploaded Description Edit
cleanup_map_usage.patch collinwinter, 2006-06-27 16:53 Clean up usage of map(), against r47131 review
lib_string-r65106 grubert, 2008-07-18 18:57
Messages (19)
msg50542 - (view) Author: Collin Winter (collinwinter) * (Python committer) Date: 2006-06-27 12:15
This patch cleans up the usage of map() in the standard
library. Among other things, it removes several usages
of things like map(None, x), as well as simplifying a
number of map(lambda: ..., x) expressions.

This patch is against r47124.
msg50543 - (view) Author: Jim Jewett (jimjjewett) Date: 2006-06-27 15:15
Logged In: YES 
user_id=764593

Some cases are definately an improvement.
msg50544 - (view) Author: Collin Winter (collinwinter) * (Python committer) Date: 2006-06-27 15:24
Logged In: YES 
user_id=1344176

Which ones would you like to see reverted (ie, which ones
are not an improvement)? I've found some more cases that can
be improved, so a new version of the patch will be on the
way shortly.
msg50545 - (view) Author: Jim Jewett (jimjjewett) Date: 2006-06-27 15:46
Logged In: YES 
user_id=764593

There are none I would suggest reverting; it is just that 
some are clear wins and others are not so important.
msg50546 - (view) Author: Collin Winter (collinwinter) * (Python committer) Date: 2006-06-27 16:53
Logged In: YES 
user_id=1344176

Updated the patch to r47131 and added a bunch of new cleanups.
msg50547 - (view) Author: Anthony Baxter (anthonybaxter) (Python triager) Date: 2006-07-25 08:24
Logged In: YES 
user_id=29957

map(None, ...) should definitely be expunged. The others
should be addressed on a case-by-case basis. I'll have a
read-through of the patch. 
msg50548 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-08-14 22:04
Logged In: YES 
user_id=849994

Can wait until 2.6.
msg69967 - (view) Author: engelbert gruber (grubert) * Date: 2008-07-18 18:38
and now it is 2.6 ?
msg69968 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-07-18 18:42
May even be too late for 2.6. :)
msg69969 - (view) Author: engelbert gruber (grubert) * Date: 2008-07-18 18:46
i just wanted to get rid of one "python2.6 -3" warning in string and
found that a patch was already waiting. from this thing i conclude
smaller patches might get committed earlier , do they ?

On Fri, Jul 18, 2008 at 8:42 PM, Georg Brandl <report@bugs.python.org> wrote:
>
> Georg Brandl <georg@python.org> added the comment:
>
> May even be too late for 2.6. :)
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue1513299>
> _______________________________________
>
msg69970 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-07-18 18:47
That is true. Barry might not want to allow a large catch-all patch; but
since those changes are not adding new features, simple small ones can
certainly get in before beta3.
msg69972 - (view) Author: engelbert gruber (grubert) * Date: 2008-07-18 18:50
so i add a one liner replacing map(None with list ?

On 7/18/08, Georg Brandl <report@bugs.python.org> wrote:
>
>  Georg Brandl <georg@python.org> added the comment:
>
>
> That is true. Barry might not want to allow a large catch-all patch; but
>  since those changes are not adding new features, simple small ones can
>  certainly get in before beta3.
>
>
>  _______________________________________
>  Python tracker <report@bugs.python.org>
>  <http://bugs.python.org/issue1513299>
>  _______________________________________
>
msg69975 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-07-18 18:53
I can replace those too.
msg69977 - (view) Author: engelbert gruber (grubert) * Date: 2008-07-18 18:57
it is only one in string.py, but then again it is save to do.

thanks

On 7/18/08, Georg Brandl <report@bugs.python.org> wrote:
>
>  Georg Brandl <georg@python.org> added the comment:
>
>
> I can replace those too.
>
>
>  _______________________________________
>  Python tracker <report@bugs.python.org>
>  <http://bugs.python.org/issue1513299>
>  _______________________________________
>
msg69980 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-07-18 19:06
OK, I nixed the "simple" uses of map(None, a).
msg69981 - (view) Author: engelbert gruber (grubert) * Date: 2008-07-18 19:15
http://bugs.python.org/issue3390 is similar trivial , replacing has_key by in
(this small patches might be considered tweaking the bugfix statistic)

i am off now (tell me if you think i should stay there)

On 7/18/08, Georg Brandl <report@bugs.python.org> wrote:
>
>  Georg Brandl <georg@python.org> added the comment:
>
>
> OK, I nixed the "simple" uses of map(None, a).
>
>
>  _______________________________________
>  Python tracker <report@bugs.python.org>
>  <http://bugs.python.org/issue1513299>
>  _______________________________________
>
msg110454 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-07-16 15:35
msg69981 refers to #3390 which was closed fixed for has_key.  As this is similar could this go into 3.2 subject to acceptance?  The patch file is really a list of one line changes to get rid of map.
msg110460 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-07-16 15:55
I'll have a look.
msg123331 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-12-04 10:39
Committed what was left applicable of the patch in r87020.
History
Date User Action Args
2010-12-04 10:39:29georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg123331
2010-11-28 04:23:36eric.araujosetnosy: + eric.araujo, - BreamoreBoy
2010-07-16 15:55:13georg.brandlsetassignee: anthonybaxter -> georg.brandl
messages: + msg110460
2010-07-16 15:35:22BreamoreBoysetnosy: + BreamoreBoy

messages: + msg110454
versions: + Python 3.2, - Python 3.1, Python 2.7
2009-05-12 12:42:00ajaksu2setstage: patch review
type: enhancement
versions: + Python 3.1, Python 2.7, - Python 2.6
2008-07-18 19:15:05grubertsetmessages: + msg69981
2008-07-18 19:06:58georg.brandlsetmessages: + msg69980
2008-07-18 18:57:34grubertsetfiles: + lib_string-r65106
messages: + msg69977
2008-07-18 18:53:58georg.brandlsetmessages: + msg69975
2008-07-18 18:50:22grubertsetmessages: + msg69972
2008-07-18 18:47:45georg.brandlsetmessages: + msg69970
2008-07-18 18:46:35grubertsetmessages: + msg69969
2008-07-18 18:42:30georg.brandlsetmessages: + msg69968
2008-07-18 18:38:29grubertsetnosy: + grubert
messages: + msg69967
2006-06-27 12:15:33collinwintercreate