From: Greg Price Date: Sun, 20 Dec 2009 02:59:59 +0000 (-0500) Subject: list.mako: map/lambda make Guido sad, use a comprehension X-Git-Tag: 0.1.0^2~16 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/commitdiff_plain/680dea8afeb9fb32974c2db772e0b2861c1af4d8?ds=sidebyside list.mako: map/lambda make Guido sad, use a comprehension 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 --- diff --git a/code/templates/list.mako b/code/templates/list.mako index 7b1fd92..d513763 100644 --- a/code/templates/list.mako +++ b/code/templates/list.mako @@ -104,7 +104,7 @@ ${self.fn.cdromList(defaults.cdrom, "$('cd_or_auto_cd').checked = true;$('autoin ${machine.owner} ${machine.administrator} % if machine.nics: - ${', '.join(map(lambda x: x.ip, machine.nics))} + ${', '.join(nic.ip for nic in machine.nics)} % else: % endif