DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Juraj Linkeš" <juraj.linkes@pantheon.tech>
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, "Juraj Linkeš" <juraj.linkes@pantheon.tech>
Subject: [PATCH v1 2/4] dts: unify class inheritance from object
Date: Tue, 23 Apr 2024 11:12:50 +0200	[thread overview]
Message-ID: <20240423091252.62924-3-juraj.linkes@pantheon.tech> (raw)
In-Reply-To: <20240423091252.62924-1-juraj.linkes@pantheon.tech>

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š <juraj.linkes@pantheon.tech>
---
 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


  parent reply	other threads:[~2024-04-23  9:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-23  9:12 [PATCH v1 0/4] node and inheritance improvements Juraj Linkeš
2024-04-23  9:12 ` [PATCH v1 1/4] dts: add tg node execution setup and teardown Juraj Linkeš
2024-04-23  9:18   ` Luca Vizzarro
2024-04-30 16:15     ` Jeremy Spewock
2024-04-23  9:12 ` Juraj Linkeš [this message]
2024-04-23  9:19   ` [PATCH v1 2/4] dts: unify class inheritance from object Luca Vizzarro
2024-04-23 14:53   ` Patrick Robb
2024-04-30 16:15     ` Jeremy Spewock
2024-04-23  9:12 ` [PATCH v1 3/4] dts: unify super calls Juraj Linkeš
2024-04-23 10:06   ` Luca Vizzarro
2024-04-23 14:57   ` Patrick Robb
2024-04-30 16:15     ` Jeremy Spewock
2024-04-23  9:12 ` [PATCH v1 4/4] dts: refine pre-test setup and teardown steps Juraj Linkeš
2024-04-23  9:19   ` Luca Vizzarro
2024-04-30 16:15     ` Jeremy Spewock
2024-04-23 10:07 ` [PATCH v1 0/4] node and inheritance improvements Luca Vizzarro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240423091252.62924-3-juraj.linkes@pantheon.tech \
    --to=juraj.linkes@pantheon.tech \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=Luca.Vizzarro@arm.com \
    --cc=dev@dpdk.org \
    --cc=jspewock@iol.unh.edu \
    --cc=npratte@iol.unh.edu \
    --cc=paul.szczepanek@arm.com \
    --cc=probb@iol.unh.edu \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).