On Thu, Feb 19, 2015 at 12:59 PM, Dylan Baker <[email protected]> wrote: >> + return -1.0 if any(ret['badlands']) else map(float, >> ret['component_tolerances']) > > Generally at this point python (both upstream and community) discourage > the use of map and filter, with a preference for comprehensions. > [float(x) for x in ret['component_tolerances']] should be what you want.
Just to provide a counterpoint, I think that map(float, fooarray) is a ton more readable than list(float(x) for x in fooarray) That said, once you start moving to a lambda function, the map loses its appeal in improved readability. Similar rationale for filter. -ilia _______________________________________________ Piglit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/piglit
