Skip to content

Commit 382a345

Browse files
committed
Remove unnecessary use of 'object' in class construction
Considering we are not compatible with Python 2 anymore, we can drop the 'object' explicit inheritance in the class declaration. Pick-to: 6.8 Change-Id: Iac3a95aa9721c3ff1a755f457c0936ca157a8470 Reviewed-by: Shyamnath Premnadh <[email protected]> Reviewed-by: Friedemann Kleint <[email protected]>
1 parent 03a3e61 commit 382a345

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+59
-57
lines changed

build_scripts/build_info_collector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def get_py_library(build_type, py_version, py_prefix, py_libdir, py_include_dir)
130130
return py_library
131131

132132

133-
class BuildInfoCollectorMixin(object):
133+
class BuildInfoCollectorMixin:
134134
build_base: str
135135
build_lib: str
136136
cmake: str

build_scripts/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import tomli as tomllib
1818

1919

20-
class Config(object, metaclass=Singleton):
20+
class Config(metaclass=Singleton):
2121
def __init__(self):
2222
# Constants
2323
self._build_type_all = "all"

build_scripts/options.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def _warn_deprecated_option(option, replacement=None):
4141
log.warning(w)
4242

4343

44-
class Options(object, metaclass=Singleton):
44+
class Options(metaclass=Singleton):
4545
def __init__(self):
4646

4747
# Dictionary containing values of all the possible options.
@@ -181,7 +181,7 @@ def resolve(self):
181181
}
182182

183183

184-
class CommandMixin(object):
184+
class CommandMixin:
185185
"""Mixin for the setuptools build/install commands handling the options."""
186186

187187
_static_class_finalized_once = False

build_scripts/qtinfo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
platform_cmake_options)
1111

1212

13-
class QtInfo(object):
13+
class QtInfo:
1414
_instance = None # singleton helpers
1515

1616
def __new__(cls): # __new__ always a classmethod

build_scripts/setup_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from build_scripts.log import log, LogLevel
2020

2121

22-
class SetupRunner(object):
22+
class SetupRunner:
2323
def __init__(self, orig_argv):
2424
self.invocations_list = []
2525

examples/widgets/itemviews/stardelegate/starrating.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
PAINTING_SCALE_FACTOR = 20
1313

1414

15-
class StarRating(object):
15+
class StarRating:
1616
""" Handle the actual painting of the stars themselves. """
1717

1818
def __init__(self, starCount=1, maxStarCount=5):

examples/widgets/tutorials/addressbook/part2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414

1515
class SortedDict(dict):
16-
class Iterator(object):
16+
class Iterator:
1717
def __init__(self, sorted_dict):
1818
self._dict = sorted_dict
1919
self._keys = sorted(self._dict.keys())

examples/widgets/tutorials/addressbook/part3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414

1515
class SortedDict(dict):
16-
class Iterator(object):
16+
class Iterator:
1717
def __init__(self, sorted_dict):
1818
self._dict = sorted_dict
1919
self._keys = sorted(self._dict.keys())

examples/widgets/tutorials/addressbook/part4.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414

1515
class SortedDict(dict):
16-
class Iterator(object):
16+
class Iterator:
1717
def __init__(self, sorted_dict):
1818
self._dict = sorted_dict
1919
self._keys = sorted(self._dict.keys())

examples/widgets/tutorials/addressbook/part5.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414

1515
class SortedDict(dict):
16-
class Iterator(object):
16+
class Iterator:
1717
def __init__(self, sorted_dict):
1818
self._dict = sorted_dict
1919
self._keys = sorted(self._dict.keys())

0 commit comments

Comments
 (0)