'is not' or '!='

Dan Stromberg drsalists at gmail.com
Thu Aug 21 15:24:12 EDT 2014


On Mon, Aug 18, 2014 at 1:35 PM, ElChino <elchino at cnn.cn> wrote:
> A newbie question to you; what is the difference between statements like:
>  if x is not None:
> and
> if x != None:
>
> Without any context, which one should be preferred?
> IMHO, the latter is more readable.

You've got some good answers.

I'd like to point out that this might make a good entry in a Python FAQ list...



More information about the Python-list mailing list