[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87sebxitjs.fsf@yellow.woof>
Date: Thu, 22 Jan 2026 15:57:43 +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 09/26] rv/rvgen: replace inline NotImplemented with
decorator
Wander Lairson Costa <wander@...hat.com> writes:
> Replace inline NotImplementedError raises with a dedicated decorator in
> the ltl2ba module. The previous implementation used explicit raise
> statements inside abstract method bodies for BinaryOp and UnaryOp
> classes, which required maintaining identical boilerplate across seven
> different methods that need to be overridden by subclasses.
>
> All stub methods in generator.py have been converted from returning
> strings to using the decorator with ellipsis function bodies, which
> is the recommended Python style for marking incomplete interface
> methods. This ensures that any attempt to use unimplemented
> functionality fails fast with a clear exception rather than silently
> propagating string values through the code.
>
> The new @not_implemented decorator consolidates this pattern into a
> single reusable definition that clearly marks abstract methods while
> reducing code duplication. The decorator creates a wrapper that raises
> NotImplementedError with the function name, providing the same runtime
> behavior with improved maintainability. Method bodies now use the
> ellipsis literal instead of pass statements, which is the preferred
> Python convention for stub methods according to PEP 8.
>
> Signed-off-by: Wander Lairson Costa <wander@...hat.com>
Reviewed-by: Nam Cao <namcao@...utronix.de>
Powered by blists - more mailing lists