It's Python's conditional expression, `expression_true if condition else expression_false`. It's the same thing as C's ternary: `condition ? expression_true : expression_false` Also yes, you could put any expression in the parentheses. Just that the empty one is actually just an empty tuple. _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/D3VEKV7R4KUTSFEN2I5NZUGWN6R5QZE7/ Code of Conduct: http://python.org/psf/codeofconduct/
- [Python-ideas] Expand the try-expect syntax to su... Nadav Misgav
- [Python-ideas] Re: Expand the try-expect syn... Serhiy Storchaka
- [Python-ideas] Re: Expand the try-expect... nadav . misgav
- [Python-ideas] Re: Expand the try-ex... Jeremiah Gabriel Pascual
- [Python-ideas] Re: Expand the try-ex... Serhiy Storchaka
- [Python-ideas] Re: Expand the try-ex... Martin Di Paola
- [Python-ideas] Re: Expand the try-expect... Steven D'Aprano
- [Python-ideas] Re: Expand the try-expect... Ben Rudiak-Gould
- [Python-ideas] Re: Expand the try-expect syn... Andre Delfino
- [Python-ideas] Re: Expand the try-expect syn... Nadav Misgav
- [Python-ideas] Re: Expand the try-expect... Steven D'Aprano
- [Python-ideas] Re: Expand the try-expect... Serhiy Storchaka