diff options
Diffstat (limited to 'sources/pyside6')
19 files changed, 27 insertions, 25 deletions
diff --git a/sources/pyside6/doc/inheritance_graph.py b/sources/pyside6/doc/inheritance_graph.py index c45791ba5..2796226e1 100644 --- a/sources/pyside6/doc/inheritance_graph.py +++ b/sources/pyside6/doc/inheritance_graph.py @@ -32,7 +32,7 @@ def format_dict(d): return result -class InheritanceGraph(object): +class InheritanceGraph: """ Given a list of classes, determines the set of classes that they inherit from all the way to the root "object", and then is able to generate a diff --git a/sources/pyside6/tests/QtCore/bug_835.py b/sources/pyside6/tests/QtCore/bug_835.py index ffc599ee9..6bf4f261e 100644 --- a/sources/pyside6/tests/QtCore/bug_835.py +++ b/sources/pyside6/tests/QtCore/bug_835.py @@ -18,7 +18,7 @@ get_counter = 0 set_counter = 0 -class Descriptor(object): +class Descriptor: def __get__(self, obj, owner): global get_counter diff --git a/sources/pyside6/tests/QtCore/classinfo_test.py b/sources/pyside6/tests/QtCore/classinfo_test.py index abd1c55b9..03f60db22 100644 --- a/sources/pyside6/tests/QtCore/classinfo_test.py +++ b/sources/pyside6/tests/QtCore/classinfo_test.py @@ -93,7 +93,7 @@ class TestClassInfo(unittest.TestCase): pass self.assertRaises(TypeError, make_info(), test_function) - class NotAQObject(object): + class NotAQObject: pass self.assertRaises(TypeError, make_info(), NotAQObject) diff --git a/sources/pyside6/tests/QtCore/mockclass_test.py b/sources/pyside6/tests/QtCore/mockclass_test.py index 07dca7a6d..b588148d1 100644 --- a/sources/pyside6/tests/QtCore/mockclass_test.py +++ b/sources/pyside6/tests/QtCore/mockclass_test.py @@ -18,7 +18,7 @@ init_test_paths(False) from PySide6.QtCore import QCoreApplication -class Mock(object): +class Mock: def __init__(self): self.called = False self.return_value = None diff --git a/sources/pyside6/tests/QtCore/qbytearray_operator_iadd_test.py b/sources/pyside6/tests/QtCore/qbytearray_operator_iadd_test.py index cd14941bc..a319d604d 100644 --- a/sources/pyside6/tests/QtCore/qbytearray_operator_iadd_test.py +++ b/sources/pyside6/tests/QtCore/qbytearray_operator_iadd_test.py @@ -15,7 +15,7 @@ from PySide6.QtCore import QByteArray from helper.docmodifier import DocModifier -class BaseQByteArrayOperatorIAdd(object): +class BaseQByteArrayOperatorIAdd: '''Base class for QByteArray += operator tests. Implementing classes should inherit from unittest.TestCase and implement diff --git a/sources/pyside6/tests/QtCore/qobject_inherits_test.py b/sources/pyside6/tests/QtCore/qobject_inherits_test.py index bdd927fe2..e1121abd7 100644 --- a/sources/pyside6/tests/QtCore/qobject_inherits_test.py +++ b/sources/pyside6/tests/QtCore/qobject_inherits_test.py @@ -44,7 +44,7 @@ class InheritsCase(unittest.TestCase): # QObject.inherits(classname) should fail if classname isn't a # QObject subclass - class Parent(object): + class Parent: # Dummy parent pass @@ -71,6 +71,8 @@ class InheritsCase(unittest.TestCase): def testMultipleInheritance(self): def declareClass(): + # Note: 'object' cannot removed from this class declaration + # in order to make it work with QObject. class Foo(object, QObject): pass diff --git a/sources/pyside6/tests/QtQml/bug_825_old.py b/sources/pyside6/tests/QtQml/bug_825_old.py index e27cb14bc..e1a35d3d9 100644 --- a/sources/pyside6/tests/QtQml/bug_825_old.py +++ b/sources/pyside6/tests/QtQml/bug_825_old.py @@ -30,7 +30,7 @@ class MetaA(type): pass -class A(object): +class A: __metaclass__ = MetaA diff --git a/sources/pyside6/tests/QtUiTools/bug_426.py b/sources/pyside6/tests/QtUiTools/bug_426.py index 2f09afb73..d1dc7d9e3 100644 --- a/sources/pyside6/tests/QtUiTools/bug_426.py +++ b/sources/pyside6/tests/QtUiTools/bug_426.py @@ -16,7 +16,7 @@ from PySide6.QtWidgets import QApplication from PySide6.QtUiTools import QUiLoader -class Window(object): +class Window: def __init__(self): loader = QUiLoader() filePath = os.path.join(os.path.dirname(__file__), 'bug_426.ui') diff --git a/sources/pyside6/tests/QtWidgets/bug_836.py b/sources/pyside6/tests/QtWidgets/bug_836.py index b9d39d875..9486233e3 100644 --- a/sources/pyside6/tests/QtWidgets/bug_836.py +++ b/sources/pyside6/tests/QtWidgets/bug_836.py @@ -15,15 +15,15 @@ from PySide6.QtCore import QTimer from PySide6.QtWidgets import QApplication, QFrame -class Mixin1(object): +class Mixin1: pass -class Mixin2(object): +class Mixin2: pass -class Mixin3(object): +class Mixin3: pass diff --git a/sources/pyside6/tests/QtWidgets/bug_921.py b/sources/pyside6/tests/QtWidgets/bug_921.py index 5e9dcd05a..ef84219c4 100644 --- a/sources/pyside6/tests/QtWidgets/bug_921.py +++ b/sources/pyside6/tests/QtWidgets/bug_921.py @@ -24,7 +24,7 @@ class Signaller(QObject): s3 = Signal() -class Window(object): +class Window: def __init__(self, s): self._window = QMainWindow() diff --git a/sources/pyside6/tests/QtWidgets/import_test.py b/sources/pyside6/tests/QtWidgets/import_test.py index 0b60241f0..cb810c025 100644 --- a/sources/pyside6/tests/QtWidgets/import_test.py +++ b/sources/pyside6/tests/QtWidgets/import_test.py @@ -1,2 +1,2 @@ -class PysideImportTest2(object): +class PysideImportTest2: pass diff --git a/sources/pyside6/tests/QtWidgets/qvariant_test.py b/sources/pyside6/tests/QtWidgets/qvariant_test.py index 0e1ecc2c9..74731e914 100644 --- a/sources/pyside6/tests/QtWidgets/qvariant_test.py +++ b/sources/pyside6/tests/QtWidgets/qvariant_test.py @@ -28,7 +28,7 @@ class MyItem(QGraphicsRectItem): return value -class Sequence(object): +class Sequence: # Having the __getitem__ method on a class transform the Python # type to a PySequence. # Before the patch: aa75437f9119d997dd290471ac3e2cc88ca88bf1 diff --git a/sources/pyside6/tests/pysidetest/mixin_signal_slots_test.py b/sources/pyside6/tests/pysidetest/mixin_signal_slots_test.py index 3209f749f..7e1ddbb17 100644 --- a/sources/pyside6/tests/pysidetest/mixin_signal_slots_test.py +++ b/sources/pyside6/tests/pysidetest/mixin_signal_slots_test.py @@ -20,7 +20,7 @@ init_test_paths(False) from PySide6.QtCore import QObject, Signal, Slot -class Mixin(object): +class Mixin: mixinSignal = Signal() def __init__(self, *args, **kwargs): @@ -39,7 +39,7 @@ class MixinTwo(Mixin): self.mixinTwoSlotCalled = True -class MixinThree(object): +class MixinThree: mixinThreeSignal = Signal() def __init__(self, *args, **kwargs): diff --git a/sources/pyside6/tests/pysidetest/multiple_inheritance_test.py b/sources/pyside6/tests/pysidetest/multiple_inheritance_test.py index a9808cfa3..fee2eea8d 100644 --- a/sources/pyside6/tests/pysidetest/multiple_inheritance_test.py +++ b/sources/pyside6/tests/pysidetest/multiple_inheritance_test.py @@ -22,7 +22,7 @@ def xprint(*args, **kw): # This is the original testcase of PYSIDE-1564 -class Age(object): +class Age: def __init__(self, age=0, **kwds): super().__init__(**kwds) @@ -117,7 +117,7 @@ class II(G, H, QtWidgets.QLabel): # PYSIDE-2294: Friedemann's test adapted. # We need to ignore positional args in mixin classes. -class Ui_X_MainWindow(object): # Emulating uic +class Ui_X_MainWindow: # Emulating uic def setupUi(self, MainWindow): MainWindow.resize(400, 300) self.lbl = QLabel(self) @@ -160,7 +160,7 @@ class AdditionalMultipleInheritanceTest(UsesQApplication): # PYSIDE-2654: Additional missing init test. # This must work if no __init__ is defined (Ui_Form) -class Ui_Form(object): +class Ui_Form: pass diff --git a/sources/pyside6/tests/pysidetest/property_python_test.py b/sources/pyside6/tests/pysidetest/property_python_test.py index e26f07bb9..faf509f1f 100644 --- a/sources/pyside6/tests/pysidetest/property_python_test.py +++ b/sources/pyside6/tests/pysidetest/property_python_test.py @@ -89,7 +89,7 @@ class SubClass(BaseClass): raise PropertyDel(self._spam) -class PropertyDocBase(object): +class PropertyDocBase: _spam = 1 def _get_spam(self): @@ -188,7 +188,7 @@ class PropertyTests(unittest.TestCase): @unittest.skipIf(sys.flags.optimize >= 2, "Docstrings are omitted with -O2 and above") def test_property_decorator_doc_writable(self): - class PropertyWritableDoc(object): + class PropertyWritableDoc: @Property(object) def spam(self): diff --git a/sources/pyside6/tests/registry/init_platform.py b/sources/pyside6/tests/registry/init_platform.py index 0a040d0fc..e911f2182 100644 --- a/sources/pyside6/tests/registry/init_platform.py +++ b/sources/pyside6/tests/registry/init_platform.py @@ -104,7 +104,7 @@ from shibokensupport.signature.lib.enum_sig import SimplifyingEnumerator # noqa sourcepath = os.path.splitext(__file__)[0] + ".py" -class Formatter(object): +class Formatter: """ Formatter is formatting the signature listing of an enumerator. diff --git a/sources/pyside6/tests/util/helper/basicpyslotcase.py b/sources/pyside6/tests/util/helper/basicpyslotcase.py index 80da149bd..b495eaead 100644 --- a/sources/pyside6/tests/util/helper/basicpyslotcase.py +++ b/sources/pyside6/tests/util/helper/basicpyslotcase.py @@ -5,7 +5,7 @@ from __future__ import annotations import gc -class BasicPySlotCase(object): +class BasicPySlotCase: '''Base class that tests python slots and signal emissions. Python slots are defined as any callable passed to QObject.connect(). diff --git a/sources/pyside6/tests/util/helper/docmodifier.py b/sources/pyside6/tests/util/helper/docmodifier.py index b6de62abb..ee95d9a0f 100644 --- a/sources/pyside6/tests/util/helper/docmodifier.py +++ b/sources/pyside6/tests/util/helper/docmodifier.py @@ -59,7 +59,7 @@ class DocModifier(type): if __name__ == '__main__': # tests - class BaseTest(object): + class BaseTest: __metaclass__ = DocModifier def testBase(self): diff --git a/sources/pyside6/tests/util/processtimer.py b/sources/pyside6/tests/util/processtimer.py index 8187901c6..905405585 100644 --- a/sources/pyside6/tests/util/processtimer.py +++ b/sources/pyside6/tests/util/processtimer.py @@ -15,7 +15,7 @@ class TimeoutException(Exception): return repr(self.msg) -class ProcessTimer(object): +class ProcessTimer: '''Timeout function for controlling a subprocess.Popen instance. Naive implementation using busy loop, see later other means |