``if var'' and ``if var is not None''

Chris Angelico rosuav at gmail.com
Sun Sep 1 02:26:01 EDT 2019


On Sun, Sep 1, 2019 at 4:16 PM Hongyi Zhao <hongyi.zhao at gmail.com> wrote:
>
> Hi,
>
> The following two forms are always equivalent:
>
> ``if var'' and ``if var is not None''
>

Ahhhhhh... False. I'll go False. I'll be honest, I might have heard
that one before, though. Sort of cheating.

ChrisA



More information about the Python-list mailing list