To me, the major problem with the (a and [b] or [c])[0] solution shown in the FAQ is that it's not immediately clear what you are doing. A more likely spelling of that solution is: def ifelse(result): return result[0] ... x1 = ifelse(a and [x] or [y]) x2 = ifelse(a and [x] or b and [y] or [z]) x3 = ifelse(a and [x] or b and [y] or c and ...) The q() function solution shown there doesn't extend as nicely and forces you to add "lambda:" if you don't want both alternatives evaluated. -Jerry
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