On 15 Jul 2023, at 23:14, Dom Grigonis <dom.grigo...@gmail.com> wrote:
I am well aware of that.
I just argue that it is not very pleasant to read.
Personally, I am not a big user of it.
C’s although maybe doesn’t have words to read, but is much more pleasant in both conciseness and logical sequence.
Maybe it is not a big issue for others, but if C’s style conditional _expression_ existed, it would significantly change the way I write things.
I agree with you and avoid the python version, and refactor it out of code.As you say ii also find it hard to read, and familiarity is not helping. The C and rust versions I do use.
Barry
So just checking. :)
So I would vote for something similar to: result = bar is None ? default : bar
result = default if bar is None else bar
Python has a conditional _expression_ already. Paul
_______________________________________________Python-ideas mailing list -- python-ideas@python.orgTo unsubscribe send an email to python-ideas-le...@python.orghttps://mail.python.org/mailman3/lists/python-ideas.python.org/Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/QARSVXWITOLFAXZZJLIEBSPFO35PRDDS/Code of Conduct: http://python.org/psf/codeofconduct/
|
_______________________________________________
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/QUUEWVIEBABWDJCCPCSQYNIGDS2MYGC4/
Code of Conduct: http://python.org/psf/codeofconduct/