[Python-ideas] PEP 505: None-aware operators

Grégory Lielens gregory.lielens at gmail.com
Sun Jul 22 09:22:59 EDT 2018


The ?? operator is probably the less scary one regarding legibility, and in guessing (or remembering) what it exactly does...
Well, at least I think I understand what it does exactly, but if I'm not wrong there, what it does is also quite simple and minimal.

A function returning it's first non-None argument (or None, if all args are None) will provide the same functionality, with not much typing. You have parenthesis for the call, but you will probably need them anyway to group things, for correcting precedence, or helping the reader to parse your expression even if precedence was right.
You have an extra call, so ?? may be more efficient...maybe. 

Is that a reason enough, together with a few letters saved typing, to introduce ?? ? Not for me...


More information about the Python-ideas mailing list