mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vincent Bernat <vincent@bernat.ch>
To: Kieran Bingham <kbingham@kernel.org>
Cc: Jan Kiszka <jan.kiszka@siemens.com>,
	Stephen Boyd <swboyd@chromium.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scripts/gdb: replace "is 0" by "== 0"
Date: Fri, 20 Mar 2020 18:05:52 +0100	[thread overview]
Message-ID: <m3wo7f553j.fsf@bernat.ch> (raw)
In-Reply-To: <55dae299-a5a0-6e11-c966-1d8dcb46c452@kernel.org> (Kieran Bingham's message of "Fri, 20 Mar 2020 16:47:19 +0000")

 ❦ 20 mars 2020 16:47 +00, Kieran Bingham:

> Oh, I thought python encouraged the 'is' style.

Usually, only for "None", "False" or "True" (but for the latest, this
doesn't usually make sense).

> Given the nature of the statement, would
>
> if not node:
>     return None
>
> be any more appropriate ?

It would be more consistent with the other uses (like the while below
and the ifs even further). However, I don't fully understand this code
(notably the "node = node.address.cast(...)" where node is not defined
yet and node is replaced by the value of "root['rb_node']" just after),
so can't say for sure node cannot be equal to something eveluating to
False in some conditions.
-- 
Writing is easy; all you do is sit staring at the blank sheet of paper until
drops of blood form on your forehead.
		-- Gene Fowler

  reply	other threads:[~2020-03-20 17:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-20 16:38 Vincent Bernat
2020-03-20 16:47 ` Kieran Bingham
2020-03-20 17:05   ` Vincent Bernat [this message]
2020-03-20 16:48 ` Stephen Boyd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3wo7f553j.fsf@bernat.ch \
    --to=vincent@bernat.ch \
    --cc=jan.kiszka@siemens.com \
    --cc=kbingham@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=swboyd@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome