[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87y0lpituz.fsf@yellow.woof>
Date: Thu, 22 Jan 2026 15:51:00 +0100
From: Nam Cao <namcao@...utronix.de>
To: Wander Lairson Costa <wander@...hat.com>, Steven Rostedt
<rostedt@...dmis.org>, Gabriele Monaco <gmonaco@...hat.com>, Wander
Lairson Costa <wander@...hat.com>, open list
<linux-kernel@...r.kernel.org>, "open list:RUNTIME VERIFICATION (RV)"
<linux-trace-kernel@...r.kernel.org>
Subject: Re: [PATCH 07/26] rv/rvgen: replace __contains__() with in operator
Wander Lairson Costa <wander@...hat.com> writes:
> Replace the direct call to the __contains__() dunder method with the
> idiomatic in operator in the dot2c module. The previous implementation
> explicitly called the __contains__() method to check for membership in
> the final_states collection, which is not the recommended Python
> style.
>
> Python provides the in operator as the proper way to test membership,
> which internally calls the __contains__() method. Directly calling
> dunder methods bypasses Python's abstraction layer and reduces code
> readability. Using the in operator makes the code more natural and
> familiar to Python developers while maintaining identical functionality.
>
> Signed-off-by: Wander Lairson Costa <wander@...hat.com>
Reviewed-by: Nam Cao <namcao@...utronix.de>
Powered by blists - more mailing lists