list.mako: map/lambda make Guido sad, use a comprehension
authorGreg Price <price@mit.edu>
Sun, 20 Dec 2009 02:59:59 +0000 (21:59 -0500)
committerGreg Price <price@mit.edu>
Sun, 20 Dec 2009 02:59:59 +0000 (21:59 -0500)
In Python jargon this is not actually a "comprehension", which is
reserved for list comprehensions, but a "generator expression".
Just in case someone cares.

svn path=/package_branches/invirt-web/cherrypy-rebased/; revision=2719

code/templates/list.mako

index 7b1fd92..d513763 100644 (file)
@@ -104,7 +104,7 @@ ${self.fn.cdromList(defaults.cdrom, "$('cd_or_auto_cd').checked = true;$('autoin
        <td>${machine.owner}</td>
        <td>${machine.administrator}</td>
 % if machine.nics:
-       <td>${', '.join(map(lambda x: x.ip, machine.nics))}</td>
+       <td>${', '.join(nic.ip for nic in machine.nics)}</td>
 % else:
        <td></td>
 % endif