On Tue, Aug 19, 2014 at 7:12 AM, Skip Montanaro <s...@pobox.com> wrote: > The use of "is" or "is not" is the right thing to do when the object > of the comparison is known to be a singleton. That is true for None. > (I suspect it's true for True and False as well, though for historical > and idiomatic reasons "x is True" is never used.) It would also be > true if you created a sentinel object like this: > > SENTINEL = []
When I need to do this, I use: SENTINEL = object() It's still a singleton, and why should a sentinel be mutable? -- https://mail.python.org/mailman/listinfo/python-list