On Wed, Feb 19, 2014 at 3:10 AM, Mark Lawrence <breamore...@yahoo.co.uk> wrote:
> Sorry if this has already been suggested, but why not introduce a new
> singleton to make the database people happier if not happy?  To avoid
> confusion call it dbnull?  A reasonable compromise or complete cobblers? :)

That would be a major change to the DB API. Possibly the best
solution, though. Start off by having the default be to return None
(as now) and have a flag that can be set "please return sys.dbnull
instead" (does dbnull belong in sys?), and let that settle for a few
years. Recommend that all applications explicitly set the flag, either
to True or to False. Then eventually, with the full deprecation
warnings, change the default to True. (Or maybe make it an error to
not set it.) Then, after another long round of deprecations, drop the
None behaviour from the spec altogether.

But even in its early steps, that could solve the problem. Anyone who
wants to sort a list of tuples that came from the database can simply
set the flag (assuming their back-end supports that flag) and happily
use dbnull.

ChrisA
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to