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

Brendan Barnwell brenbarn at brenbarn.net
Thu Jul 19 14:39:50 EDT 2018


On 2018-07-19 06:38, Steven D'Aprano wrote:
> *Its just spelling*. If it is a useful and well-defined feature, we'll
> get used to the spelling soon enough.
>
> That's not to say that spelling is not important *at all*, or that we
> should never prefer words to symbols. But if the only objection we have
> is "this is useful but I don't like the spelling so -1" then that's
> usually a pretty weak argument against the feature.

	But we already have a spelling for the most common case.  It is:

x = a if a is not None else b

	That is the only use case of any of these operators that is actually 
common enough for me to care about --- but it's still not common enough 
to warrant the creation of a new operator, let alone multiple new operators.

-- 
Brendan Barnwell
"Do not follow where the path may lead.  Go, instead, where there is no 
path, and leave a trail."
    --author unknown


More information about the Python-ideas mailing list