Christopher Barker writes:

 > > For example, a common confusion is to identify None with NULL in
 > > DB, ... because most frameworks do not distinguish "Do not
 > > filter" and "Keep only rows where value is NULL",
 > 
 > Good example— wouldn’t it be nice if all the database interaction packages
 > used the same Sentinel for this? In that case it would go in the DB api,
 > but the idea holds.

The question is whether it's an *example* of a common need, or a
*nearly unique use case* of a generally useful distinction that
justifies a new (semi-)singleton.  Tal says that at least in the
stdlib and the other cases he's seen it's almost always an
application-specific need.  We need to see a *list* of generally
useful sentinel classes that aren't served by Tal's "_local_sentinel =
Sentinel()" idiom.  Otherwise such sentinels can be added ad hoc to
specific (though widely used) modules as module-specific APIs.

Steve

_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/ZDRV5JGZSPIESIOUNWPSNAO2O3TU5FNT/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to