Although this apparently works, it just slipped my mind when I was updated it that it may not work with windows. The original issue is that map return an iterable instead of a list. An alternative would be to cast as a list but the manual recommends rewriting as a list comprehension is probably better.
John On Nov 24, 1:43 pm, John Wiegley <[email protected]> wrote: > On Nov 24, 2010, at 12:29 PM, John Piasetzki wrote: > > > I updated acprep to work with Python 3 (tested with Python 3.1.2). > > Very cool! Just a few questions: > > > - lib64_dirs = map(lambda x: join(x, 'lib64'), search_prefixes) > > - lib_dirs = map(lambda x: join(x, 'lib'), search_prefixes) > > + lib64_dirs = [search_prefix + '/lib64' for search_prefix in > > search_prefixes] > > + lib_dirs = [search_prefix + '/lib' for search_prefix in > > search_prefixes] > > Why is this an improvement? Is '/' now a universal directory separator in > Python? Will this work on Windows? Is there a problem with map and > lambda? > > Thanks, > John
