[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <m3wo7f553j.fsf@bernat.ch>
Date: Fri, 20 Mar 2020 18:05:52 +0100
From: Vincent Bernat <vincent@...nat.ch>
To: Kieran Bingham <kbingham@...nel.org>
Cc: Jan Kiszka <jan.kiszka@...mens.com>,
Stephen Boyd <swboyd@...omium.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] scripts/gdb: replace "is 0" by "== 0"
❦ 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
Powered by blists - more mailing lists