NULL vs. None and MySQLdb

Simon Brunning SBrunning at trisystems.co.uk
Tue Sep 19 05:37:54 EDT 2000


> From:	aahz at panix.com [SMTP:aahz at panix.com]
> None is the Python equivalent of NULL; what's wrong with None?
> 
None is not the same as NULL.

None == None, but NULL <> NULL. For a numeric field, None == 0, but NULL <>
0. NULL doesn't equal *anything* - it means not applicable, unknown, or
suchlike. (I recommend SQL for Smarties by Joe Celko for a full discussion
of this.)

Python doesn't have any equivalent, AFAIK. Which is a shame - a native NULL
would be *very* useful for DB work.

Cheers,
Simon Brunning
TriSystems Ltd.
sbrunning at trisystems.co.uk





-----------------------------------------------------------------------
The information in this email is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this email by anyone else
is unauthorised. If you are not the intended recipient, any disclosure,
copying, distribution, or any action taken or omitted to be taken in
reliance on it, is prohibited and may be unlawful. TriSystems Ltd. cannot
accept liability for statements made which are clearly the senders own.



More information about the Python-list mailing list