From: "Guido van Rossum" <guido@python.org> > > Oh dear. If you are really going to do these these cutesy English-like > > expressions I'd have to resurrect my old proposal of: > > > > if CONDITION for some NAME in ITERABLE: > > if CONDITION for every NAME in ITERABLE: > > if CONDITION for no NAME in ITERABLE: > > > > Please, dont make me do that ;-) > > An if-expression is frequently requested, and I expect people will > continue to ask for it until I add one :-) > > Who (besides you) has ever asked for generalized quantifiers? They > were in ABC, with slightly different syntax: > I would not dislike to have expression forms equivalent to applications of def every(pred,l): for x in l: if not pred(x): return False return True def some(pred,l): for x in in l: if pred(x): return True return False def such(pred,l,otherwise=None): for x in in l: if pred(x): return x return otherwise as list comprehension is equivalent to map and filter.
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