On Fri, Jan 30, 2009 at 20:48, Arfrever Frehtes Taifersar Arahesis
<Arfrever.FTA_at_gmail.com> wrote:
> Author: arfrever
> Date: Fri Jan 30 11:48:25 2009
> New Revision: 35597
>
> Log:
> Follow-up to r35585:
>
> * tools/dev/graph-dav-servers.py
> (load_stats): Use list comprehension instead of map().
>
> Modified:
> trunk/tools/dev/graph-dav-servers.py
>
> Modified: trunk/tools/dev/graph-dav-servers.py
> URL: http://svn.collab.net/viewvc/svn/trunk/tools/dev/graph-dav-servers.py?pathrev=35597&r1=35596&r2=35597
> ==============================================================================
> --- trunk/tools/dev/graph-dav-servers.py Fri Jan 30 11:44:37 2009 (r35596)
> +++ trunk/tools/dev/graph-dav-servers.py Fri Jan 30 11:48:25 2009 (r35597)
> @@ -114,7 +114,7 @@ def get_ordinal_date(date):
>
> def load_stats():
> dates = [get_ordinal_date(date) for date, value in STATS]
> - counts = map(operator.itemgetter(1), STATS)
> + counts = [operator.itemgetter(1)(x) for x in STATS]
Okay... this could go either way. map() or comprehension. Fine...
BUT. If you're going to switch it to a comprehension, then *please*
... apply a bit of brain power first :-P
counts = [x[1] for x in STATS]
Cheers,
-g
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1076696
Received on 2009-01-30 22:39:33 CET