Python slang

Bernd Nawothnig Bernd.Nawothnig at t-online.de
Sat Aug 6 15:37:30 EDT 2016


On 2016-08-06, Chris Angelico wrote:
> On Sat, Aug 6, 2016 at 11:14 AM, Steven D'Aprano
><steve+python at pearwood.info> wrote:
>>> I don't ask about `None` instead of `null` because I suppose here it's
>>> a matter of disambiguation (null, in many languages, is not equal to
>>> null).
>>
>> Really? Which languages? That's not true in Pascal, C, Ruby or
>> Javascript.
>>
>
> SQL (shown here with PostgreSQL's CLI):
>
> rosuav=> \pset null NULL
> Null display is "NULL".
> rosuav=> select NULL = NULL;
>  ?column?
> ----------
>  NULL
> (1 row)
>
> But SQL's NULL is a cross between C's NULL, IEEE's NaN, Cthulhu, and
> Emrakul.

SQL NULL has the semantic of "unknown". So if one or both operands of
a comparison (or any other operation) are unknown the result is
unknown too. And that means NULL.

That is also the reason why you have the keyword STRICT when declaring
a function in PostgreSQL. If only one parameter of the function is
NULL and the result depends directly on the parameter the planner can
then automatically skip the function call completely und replace the
result by NULL without any need to analyse or enter the function body.




Bernd

-- 
no time toulouse



More information about the Python-list mailing list