Add None coalescing operator in Python

Is it more terse than **, //, <= and the other dozen or so operators we use in Python? Do you find them “unreadable” too?

If it is no more terse than the other operators you accept, then it isn’t the terseness that you object to. It must be something else.

How about operators like &, |, %, ^? I didn’t learn about bitwise operators in primary school, or even secondary school. They are twice as terse as the ?? operator. Do you dislike them twice as much?

Programming languages are not designed for the casual reader. The casual reader might, just barely, grok functions from maths class in school, but they won’t grok async, type declarations, globals and locals, closures, zip, map, regexes, Unicode, classes, imports, context managers, exceptions, etc.

The beauty of Python is that it is accessible to casual programmers. You don’t have to use null-coalescing operators any more than you have to write classes, or use closures, or use threads.

But we didn’t let those casual programmers stand in the way of Python getting classes, closures, threads, async, regexes etc. Let the casual programmers continue to write using the basic features, and the power users use the power features.

3 Likes