"Steven D. Majewski" wrote: > > > Files('.') | isGif > > Files( '.' ) is a generator that recursively enumerates all the files > starting from the current (unix) working directory. > > isGif = lambda s : s.lower().find( '.gif' ) >= 0 I propose: [yield file for file in Files('.') if file.lower.find(.'gif')>=0] By reusing the yield keyword we can get rid of the need for the new "|" or "&" syntax. Any kind of combination that can be done with list comprehensions would be possible with generator comprehensions. -- Take a recipe. Leave a recipe. Python Cookbook! http://www.ActiveState.com/pythoncookbook
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