[Moshe Zadka] > ... > Adding nothing to the discussion, let me just mention how Scheme (my > second favourite language) does it: > > (if bool true-result else-result) > > Well, of course this isn't relevant to Python because statements are not > expressions, but there might be something in it: if could be also used > as a function taking three arguments: "if" is a special form in Scheme; all Python functions are strict; short-circuiting is essential here. > print if(long_answer, "Very good!", "correct") > > I have no idea how this will play with the parser. Anyone? if(a, b, c) can't be distiguished from if (a, b, c): before the colon is seen, so it requires more lookahead than Python's parser is comfortable doing.
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