lkml.org 
[lkml]   [2020]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] scripts/gdb: replace "is 0" by "== 0"
Date
 ❦ 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

\
 
 \ /
  Last update: 2020-03-20 18:07    [W:0.055 / U:2.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site