[Python-ideas] PEP 505 (None coalescing operators) thoughts

Paul Moore p.f.moore at gmail.com
Tue Sep 29 20:48:05 CEST 2015

On 29 September 2015 at 18:15, Eric Snow <ericsnowcurrently at gmail.com> wrote:
> Personally I usually keep the defaults handling separate, like so:
> ...and given the alternatives presented here, I'd likely continue
> doing so.  To me the others are less distinct about how defaults are
> set and invite more churn if you have to do anything extra down the
> road when composing a default.  Regardless, YMMV.

Agreed, there's many ways, and the new operator doesn't really add a
huge amount (other than yet another way of doing things).

> [snip]
>> In practice, of course, I never write a default() function at the
>> moment, I just use multi-line ifs. Whether that means I'd use an or?
>> operator, I don't know. Probably - but I'd likely consider it a bit of
>> a "too many ways of doing the same thing" wart at the same time...
> Right.  And it doesn't really pay for itself when measured against that cost.


More information about the Python-ideas mailing list