On Mon, Jul 29, 2019 at 10:43 AM Richard Damon <rich...@damon-family.org> wrote:
>
> On 7/28/19 8:25 PM, Chris Angelico wrote:
> > Of course, if the third value can be simplified away (eg None means
> > "use the global default"), then you can still just use "if verbose is
> > None:" and then reassign it. But this is a legit reason to use "is
> > False".
> >
> > ChrisA
>
> The more common way to handle the 3 value case in my experience is to
> first handle the 'special case' (check for None in your example) and
> then use the normal truthiness test.
>

That works fine if you can actually handle the special case first and
dispose of it, but that doesn't always work, and when it doesn't, you
may indeed want to specify "is False" or "is True".

Chris
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to