News for hackers. Stuff that matters.
Re:Notset: A Do-Not-Care value for Python by notdonspaulding on Saturday November 10, 2012 @08:19PM (#4768401)
The sentinel value you've used here is the right solution. It keeps the keyword arguments explicit and gives None its value back. However, it doesn't deserve a module global-to-python to live in. The cases where you use this pattern are broader than just "NotSet".

Good pattern, and it needs to be more widely-known, but it doesn't need to occupy the space of a module on PyPI. ;-)

Re:Notset: A Do-Not-Care value for Python by shmeedogg on Saturday November 10, 2012 @08:28PM (#4768428)
I'd love to see this integrated into the language and live along side of `None` (I can dream, can't I?)

But until then, how can two different libraries agree to use the exact same instance of `NotSet` without some standard package defining it?

The goal is really to be able to 'proxy' this do-not-care condition from applications into libraries in a standardized way.

Re:Notset: A Do-Not-Care value for Python by notdonspaulding on Saturday November 10, 2012 @08:56PM (#4768493)
I'll repeat my advice to take this to the python-ideas mailing list. You'll get real reasons why this shouldn't (or should) be included in __builtins__.

As far as two libraries agreeing on using the same instance, one can define it the way you've done with `NotSet = object()`, and they can both use it just like they share any other named object (classes, functions, constants, sentinels). Better yet, it can carry a more meaningful name when "NotSet" doesn't really describe how they're using the sentinel.