Use fun new exciting syntax#457
Conversation
CarrotManMatt
left a comment
There was a problem hiding this comment.
Not a big fan of this to be honest. It's very much just syntax preference and the balance is incredibly negligible. Overall I'd be a -0 on this syntax as it is slightly less readable in my personal opinion (goes against "Explicit is better than implicit." from The Zen Of Python.) It relies on the fact that the reader has a good grasp of Python's truthiness logic, and can present issues when the second value is of type T | None. Whereas the ternary operator keeps this explicit.
If this syntax was used as part of a new enhancement or bugfix PR I'd happily accept it's use, but won't include a change like this just for something I don't see as a major syntax improvement beyond personal opinion. (If I understand correctly these get compiled to functionally equivalent bytecode anyways.)
Pull request was closed
No description provided.