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

Steve Dower steve.dower at python.org
Fri Jul 20 15:05:54 EDT 2018


On 20Jul2018 1119, Brendan Barnwell wrote:
> In this situation I lean toward "explicit is 
> better than implicit" --- if you want to compare against None, you 
> should do so explicitly --- and "special cases aren't special enough to 
> break the rules" --- that is, None is not special enough to warrant the 
> creation of multiple new operators solely to compare things against this 
> specific value.

"The rules" declare that None is special - it's the one and only value 
that represents "no value". So is giving it special meaning here 
breaking the rules or following them? (See also the ~50% of the PEP 
dedicated to this subject, and also consider proposing a non-special 
result for "??? if has_no_value(value) else value" in the 'True' case.)

Cheers,
Steve


More information about the Python-ideas mailing list