Right way to set a variable to NULL?

John Machin sjmachin at lexicon.net
Sat Dec 27 01:42:58 CET 2008

On Dec 27, 11:05 am, Martin <mar... at marcher.name> wrote:
> 2008/12/26 John Machin <sjmac... at lexicon.net>:
> > The above all have the same characteristic: if the input is a zero-
> > length string, then NULL is inserted into the database instead of a
> > zero-length string. Some folks (not just pedants!) regard that as an
> > important difference.
> agreed but I understood the OP specifically wanted NULL and not ''.

He wanted None inserted into the database as NULL if his regex didn't
match. He didn't invite you to change a matching '' to NULL with no

More information about the Python-list mailing list