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.lin...@pantheon.tech> Reviewed-by: Luca Vizzarro <luca.vizza...@arm.com> Reviewed-by: Patrick Robb <pr...@iol.unh.edu> Reviewed-by: Jeremy Spewock <jspew...@iol.unh.edu> --- 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 4693519bbc..5deccb6fd4 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 8768f756a6..b9f8daab1a 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 862bafb46c..6b5d5a805f 100644 --- a/dts/framework/utils.py +++ b/dts/framework/utils.py @@ -108,7 +108,7 @@ def __str__(self) -> str: return self.name -class MesonArgs(object): +class MesonArgs: """Aggregate the arguments needed to build DPDK.""" _default_library: str @@ -157,7 +157,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