From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C1C2E43EE8; Tue, 23 Apr 2024 11:13:08 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 70E3F40ED6; Tue, 23 Apr 2024 11:12:59 +0200 (CEST) Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) by mails.dpdk.org (Postfix) with ESMTP id B4F4E40E96 for ; Tue, 23 Apr 2024 11:12:56 +0200 (CEST) Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-2dd6c160eaaso25436361fa.1 for ; Tue, 23 Apr 2024 02:12:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1713863576; x=1714468376; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=POd0GSb2K63XKJkciMVY1iQ21SV6WsWHfpk4iSkhhL4=; b=hFdrA8kEzZoc+602wTT4X6KWBq4jzYp++2Qtp94R+YD20V5CUM36YZ59gVJu2E+Ey4 jUON5aW47SEsWrDoSypbK2S57NH5sgRpPagtgfInHWbZs2ec/4qcd6wihOf3ExTDf8nP yBFVKrLX7UumbtVD2ad/X0NLM3yyP6nwDD7FMCPFHIpr9xIPoZ80+NpcPCRHx1DXJtu4 drWCPpjCPntW6XsCVBeu03bG/65nniWugE+57vHJWNetFNmHrxlDyp7G7es+zqknLWgu 1Q1A9BcZb1wsyglOzjGC/jq5Ac9N8kmgWX4608s6bWJ+t1nOBN8zaEihDeLiZTwimhqW r5BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713863576; x=1714468376; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=POd0GSb2K63XKJkciMVY1iQ21SV6WsWHfpk4iSkhhL4=; b=cx7aH44baKNg3zgYYBoZrZHHNGawuocjRxdWaSb++9HGdn+HGah7J4wJAr1ItUqT07 ab+zzqQmhi6oSbgm4VjvEr5GzDh5Tl0X3UAN6al53WMRF6d5q8el+Ge1GYFCx/ld7iFx pvPUnYin4qVTwk4OkX/SJJ8cs9/wX//jF5oG7rdffHrLUS/xhlW8h1B1ytbls8IuJRxT lPjx8NM8VclVX/8F2ENc1XrkpjtNxYiz7psshq+0773jWBkN/YaNCf+cBeOv2AewqdHZ G3NMIiAQUELWXHBPxpHlVFDzF1ceWrcnDtm42RtviwOmh+axkFBW6DnNh2MHL+HkjPrb pD/g== X-Gm-Message-State: AOJu0YyGl0e7oWGdukiIY4N5W4rgsOX8AUPBfFXxszIC/WZVBerDy3w+ y2SsFf3+x6IYeRhfryMSrTr9JMyY8ytH+dkZ5BDWQRLZsOJYYoXsDYki5bDlnV4= X-Google-Smtp-Source: AGHT+IGCI8A49iSIq68CiyLKMVQRF2pPweaUoAJvkqREUw6fnOYxfpiUtJCMh1IVxX6Dvkwt4GRk5w== X-Received: by 2002:a2e:9607:0:b0:2dc:b91f:81ce with SMTP id v7-20020a2e9607000000b002dcb91f81cemr10526922ljh.10.1713863576183; Tue, 23 Apr 2024 02:12:56 -0700 (PDT) Received: from jlinkes-PT-Latitude-5530.pantheon.local (81.89.53.154.host.vnet.sk. [81.89.53.154]) by smtp.gmail.com with ESMTPSA id be12-20020a0564021a2c00b0056bf7f92346sm6440534edb.50.2024.04.23.02.12.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 02:12:55 -0700 (PDT) From: =?UTF-8?q?Juraj=20Linke=C5=A1?= To: thomas@monjalon.net, Honnappa.Nagarahalli@arm.com, jspewock@iol.unh.edu, probb@iol.unh.edu, paul.szczepanek@arm.com, Luca.Vizzarro@arm.com, npratte@iol.unh.edu Cc: dev@dpdk.org, =?UTF-8?q?Juraj=20Linke=C5=A1?= Subject: [PATCH v1 2/4] dts: unify class inheritance from object Date: Tue, 23 Apr 2024 11:12:50 +0200 Message-Id: <20240423091252.62924-3-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240423091252.62924-1-juraj.linkes@pantheon.tech> References: <20240423091252.62924-1-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org There are two ways we specify that a class inherits from object - implicitly and explicitly. There's no need to explicitly specify that a class inherits from object and is in fact mostly a remnant from Python2. Leaving it implicit is the standard in Python3 and offers a small bonus in cases where something would assign something else to the builtin object variable. Signed-off-by: Juraj Linkeš --- dts/framework/remote_session/testpmd_shell.py | 2 +- dts/framework/test_result.py | 4 ++-- dts/framework/test_suite.py | 2 +- dts/framework/testbed_model/cpu.py | 4 ++-- dts/framework/testbed_model/sut_node.py | 2 +- dts/framework/testbed_model/virtual_device.py | 2 +- dts/framework/utils.py | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py index cb2ab6bd00..9456de941d 100644 --- a/dts/framework/remote_session/testpmd_shell.py +++ b/dts/framework/remote_session/testpmd_shell.py @@ -27,7 +27,7 @@ from .interactive_shell import InteractiveShell -class TestPmdDevice(object): +class TestPmdDevice: """The data of a device that testpmd can recognize. Attributes: diff --git a/dts/framework/test_result.py b/dts/framework/test_result.py index 28f84fd793..83e637c280 100644 --- a/dts/framework/test_result.py +++ b/dts/framework/test_result.py @@ -96,7 +96,7 @@ def __bool__(self) -> bool: return self is self.PASS -class FixtureResult(object): +class FixtureResult: """A record that stores the result of a setup or a teardown. :attr:`~Result.FAIL` is a sensible default since it prevents false positives (which could happen @@ -132,7 +132,7 @@ def __bool__(self) -> bool: return bool(self.result) -class BaseResult(object): +class BaseResult: """Common data and behavior of DTS results. Stores the results of the setup and teardown portions of the corresponding stage. diff --git a/dts/framework/test_suite.py b/dts/framework/test_suite.py index 9c3b516002..7efa0eae44 100644 --- a/dts/framework/test_suite.py +++ b/dts/framework/test_suite.py @@ -27,7 +27,7 @@ from .utils import get_packet_summaries -class TestSuite(object): +class TestSuite: """The base class with building blocks needed by most test cases. * Test suite setup/cleanup methods to override, diff --git a/dts/framework/testbed_model/cpu.py b/dts/framework/testbed_model/cpu.py index 9e33b2825d..a50cf44c19 100644 --- a/dts/framework/testbed_model/cpu.py +++ b/dts/framework/testbed_model/cpu.py @@ -26,7 +26,7 @@ @dataclass(slots=True, frozen=True) -class LogicalCore(object): +class LogicalCore: """Representation of a logical CPU core. A physical core is represented in OS by multiple logical cores (lcores) @@ -50,7 +50,7 @@ def __int__(self) -> int: return self.lcore -class LogicalCoreList(object): +class LogicalCoreList: r"""A unified way to store :class:`LogicalCore`\s. Create a unified format used across the framework and allow the user to use diff --git a/dts/framework/testbed_model/sut_node.py b/dts/framework/testbed_model/sut_node.py index 97aa26d419..10d56eba8d 100644 --- a/dts/framework/testbed_model/sut_node.py +++ b/dts/framework/testbed_model/sut_node.py @@ -34,7 +34,7 @@ from .virtual_device import VirtualDevice -class EalParameters(object): +class EalParameters: """The environment abstraction layer parameters. The string representation can be created by converting the instance to a string. diff --git a/dts/framework/testbed_model/virtual_device.py b/dts/framework/testbed_model/virtual_device.py index e9b5e9c3be..569d67b007 100644 --- a/dts/framework/testbed_model/virtual_device.py +++ b/dts/framework/testbed_model/virtual_device.py @@ -7,7 +7,7 @@ """ -class VirtualDevice(object): +class VirtualDevice: """Base class for virtual devices used by DPDK. Attributes: diff --git a/dts/framework/utils.py b/dts/framework/utils.py index cc5e458cc8..f9ed1b562f 100644 --- a/dts/framework/utils.py +++ b/dts/framework/utils.py @@ -82,7 +82,7 @@ def __str__(self) -> str: return self.name -class MesonArgs(object): +class MesonArgs: """Aggregate the arguments needed to build DPDK.""" _default_library: str @@ -131,7 +131,7 @@ class _TarCompressionFormat(StrEnum): zstd = "zst" -class DPDKGitTarball(object): +class DPDKGitTarball: """Compressed tarball of DPDK from the repository. The class supports the :class:`os.PathLike` protocol, -- 2.34.1