Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:not': 0.03; 'newbie': 0.05; 'list...': 0.07; 'none:': 0.07; "subject:' ": 0.07; 'latter': 0.09; 'statements': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'cc:name:python list': 0.16; 'wrote:': 0.18; 'aug': 0.22; 'cc:addr:python.org': 0.22; 'faq': 0.24; 'mon,': 0.24; 'question': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'message-id:@mail.gmail.com': 0.30; 'context,': 0.31; "i'd": 0.34; 'received:google.com': 0.35; 'entry': 0.36; 'should': 0.36; 'pm,': 0.38; "you've": 0.63; 'more': 0.64; 'between': 0.67; 'you;': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=p3b+LaBTBdptfc1kDRoeHi4DqpGrWkd4c5vLMzq1jxU=; b=E8+DURKGDcQUL/jL/dDkj0bG5FzYmJ2ZYfpQC3e4L2eJ7R5LuVrUfRvXbQ8BtZAp0r wrDuYVoRQqbOyouaOVQfliI5p58bQ3M/UP+Xes/mVvUVT9ZdXBe3RZ0J543a5sI16Zq/ gv5W5HhytTxpMUC4E3VQlHKNJOMMFcNe+wbx7ij+4gEf0dU/ITFpwer/gh3klSdQ+khd Kcsf0j0k4isVBbGDajtKp8JA0PeQ43GSKCVso9Hhni3jRMMhWkJc99iqRRM1wSpSQjFX uLghQpocLg87OYDq41x5POAP7joyJYAB9BvhHmRZ/4Hi+U3ACiXVPBFMU3PtEolpP96f wInw== MIME-Version: 1.0 X-Received: by 10.112.184.161 with SMTP id ev1mr482816lbc.82.1408649052569; Thu, 21 Aug 2014 12:24:12 -0700 (PDT) In-Reply-To: References: Date: Thu, 21 Aug 2014 12:24:12 -0700 Subject: Re: 'is not' or '!=' From: Dan Stromberg To: ElChino Content-Type: text/plain; charset=UTF-8 Cc: Python List X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 12 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1408649055 news.xs4all.nl 2926 [2001:888:2000:d::a6]:41439 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:76746 On Mon, Aug 18, 2014 at 1:35 PM, ElChino 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...