Eric Nieuwland wrote: >>all(o==0 for o in some_objects) >>? > > > all() can be terminated at the first false element. For very long > sequences this has important performance benefits. Besides, it makes > all(seq,pred) the equivalent of pred(seq[0]) and pred(seq[1]) and > pred(seq[2]) and ... And so does the version with generator expressions: Alex' expression will also terminate with the first false statement; it is equivalent to some_objects[0]==0 and some_objects[1]==0 and ... Regards, Martin
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