On Wed, Aug 9 2000 Guido van Rossum wrote: > files = os.listdir(self.dirname) > ! list = [] > for f in files: > if pat.match(f): > ! list.append(f) > ! list = map(long, list) > ! list.sort() Isn't this just: list = os.listdir(self.dirname) list = filter(pat.match, list) list = map(long, list) list.sort() Or even shorter: list = map(long, filter(pat.match, os.listdir(self.dirname))) list.sort() (Although I can and do see the advantage of the slightly longer version.) -- Sjoerd Mullender <sjoerd.mullender@oratrix.com>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4