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/

Reply via email to