From nobody Sun Feb 8 15:57:58 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E379D231C91 for ; Mon, 19 Jan 2026 21:01:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768856496; cv=none; b=lTuMSn65QCr8h9xlSVxSf4oBORIvlSg4wp032/lfLfX6OriHq4vshmG585qx6/F+8oxX0rVGIwgQCxoc8QhvXa6BcBcGukgQB2SfG+z0mFq9r5DdvL1GbbzSgEv6r28Vt8axp+Ov31qm/niTO41IV6j5DWbaKyhd7mI3P/z9+OY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768856496; c=relaxed/simple; bh=pW65pJ3HZRQGJKGr2pCi9tYX8rTKrrz+q8humsAMrA0=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JYdhMS8eKiGQQ7o+eB+DACzlwmUNrs9zbwb2nLXVkKzaaVn8mgZ6+jI3lyHaAe9VuQxn743NtnCcVfLOGF0fvyDsKZf6P/lfTUrUSW7U8fMp/2ewJUBMAFiw2bf7pk8JD61fGwLxJiUO4Q8/s93vkQaSdkuu6IlT9KayVPX7MXs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=PYaNkPDD; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PYaNkPDD" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1768856493; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XERC8Z3HUdi/lg0y+Jk/anNqkNoun9YsdNJdLNhv39g=; b=PYaNkPDDPfFI9zGrkmZIAETbRdo6sFrdLensovEV0Zv/x2OZgOE7jc6JgNAUTjFuqO9QP3 dJCWtMlXo0NW3WMGcliBPdAiH6Tl0X2+sy6zblviYmfFBxk3XY4DU6VlembZfX2rNrJX1Z 6Zf4LT5wBZ9/qi62Q81Qg7ADHMKUiQo= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-136-P9elRolsMQyGYWDwqm3Jxw-1; Mon, 19 Jan 2026 16:01:30 -0500 X-MC-Unique: P9elRolsMQyGYWDwqm3Jxw-1 X-Mimecast-MFC-AGG-ID: P9elRolsMQyGYWDwqm3Jxw_1768856489 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 545A71800378; Mon, 19 Jan 2026 21:01:29 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.80.137]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 80BF619560AB; Mon, 19 Jan 2026 21:01:26 +0000 (UTC) From: Wander Lairson Costa To: Steven Rostedt , Gabriele Monaco , Nam Cao , Wander Lairson Costa , linux-kernel@vger.kernel.org (open list), linux-trace-kernel@vger.kernel.org (open list:RUNTIME VERIFICATION (RV)) Subject: [PATCH 07/26] rv/rvgen: replace __contains__() with in operator Date: Mon, 19 Jan 2026 17:45:43 -0300 Message-ID: <20260119205601.105821-8-wander@redhat.com> In-Reply-To: <20260119205601.105821-1-wander@redhat.com> References: <20260119205601.105821-1-wander@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Gabriele Monaco Reviewed-by: Nam Cao --- tools/verification/rvgen/rvgen/dot2c.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/verification/rvgen/rvgen/dot2c.py b/tools/verification/r= vgen/rvgen/dot2c.py index b9a2c009a9246..c97bb9466af6d 100644 --- a/tools/verification/rvgen/rvgen/dot2c.py +++ b/tools/verification/rvgen/rvgen/dot2c.py @@ -207,7 +207,7 @@ class Dot2c(Automata): else: first =3D False =20 - if self.final_states.__contains__(state): + if state in self.final_states: line =3D line + '1' else: line =3D line + '0' --=20 2.52.0