3 ms·
Giving Python a try was fun~ >>> not None and True or [False for _ in dict() if print(lambda: int is str)]
by christofosho 8y ago
Giving Python a try was fun~
>>> not None and True or [False for _ in dict() if print(lambda: int is str)]
- deathanatos 8y agoBut [] isn't really a keyword, and `dict`, `print`, `int` and `str` (and `_`) are definitely not keywords (they're just function/type names/symbols; they can be shadowed, for example).
- re 8y ago"How many keywords can I fit into a single expression" and "How many 'blue words' can I put consecutively with only spaces between them" (as described in the post) are two pretty different challenges. With only distinct keywords only separated by spaces, best I could do was 10: def _(): yield from None if not True is False else lambda :_
- uryga 8y agoup to 11! (parses on 3.7.2) async def _(): async with await None if not True is False else lambda: _: pass it's a shame that Python has so few expression keywords... `yield` can be used as an expression, but it seems to need parentheses :(