jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/680480 )
Change subject: [cleanup] Don't explicitly subclass object ......................................................................
[cleanup] Don't explicitly subclass object
Python 2.x encouraged developers to subclass object to construct 'new style' classes. However, Python 3.x dropped 'old style' classes and now subclass object by default.
Change-Id: I027813820ce867309f0ebb852e59444b223713af --- M pywikibot/xmlreader.py M tests/deprecation_tests.py M tests/login_tests.py M tests/sparql_tests.py M tests/tools_tests.py M tests/utils.py 6 files changed, 12 insertions(+), 12 deletions(-)
Approvals: JJMC89: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/xmlreader.py b/pywikibot/xmlreader.py index 3e9579d..1213355 100644 --- a/pywikibot/xmlreader.py +++ b/pywikibot/xmlreader.py @@ -90,7 +90,7 @@ xml.sax.parse(self.filename, self.handler)
-class XmlDump(object): +class XmlDump:
""" Represents an XML dump file. diff --git a/tests/deprecation_tests.py b/tests/deprecation_tests.py index 00221b7..7b0933c 100644 --- a/tests/deprecation_tests.py +++ b/tests/deprecation_tests.py @@ -160,7 +160,7 @@ return foo
-class DeprecatedMethodClass(object): +class DeprecatedMethodClass:
"""Class with methods deprecated."""
@@ -241,7 +241,7 @@
@deprecated() -class DeprecatedClassNoInit(object): +class DeprecatedClassNoInit:
"""Deprecated class."""
@@ -249,7 +249,7 @@
@deprecated() -class DeprecatedClass(object): +class DeprecatedClass:
"""Deprecated class."""
diff --git a/tests/login_tests.py b/tests/login_tests.py index 40bc70a..337a233 100644 --- a/tests/login_tests.py +++ b/tests/login_tests.py @@ -21,13 +21,13 @@ from tests import mock
-class FakeFamily(object): +class FakeFamily: """Mock."""
name = '~FakeFamily'
-class FakeSite(object): +class FakeSite: """Mock."""
code = '~FakeCode' @@ -37,7 +37,7 @@ FakeUsername = '~FakeUsername'
-class FakeConfig(object): +class FakeConfig: """Mock."""
usernames = defaultdict(dict) diff --git a/tests/sparql_tests.py b/tests/sparql_tests.py index 0f4420b..2c510cf 100644 --- a/tests/sparql_tests.py +++ b/tests/sparql_tests.py @@ -82,7 +82,7 @@ """
-class Container(object): +class Container: """Simple test container for return values."""
def __init__(self, value): @@ -171,7 +171,7 @@ self.assertFalse(res)
-class Shared(object): +class Shared: """Shared test placeholder."""
class SparqlNodeTests(TestCase): diff --git a/tests/tools_tests.py b/tests/tools_tests.py index cda8191..a5da99d 100644 --- a/tests/tools_tests.py +++ b/tests/tools_tests.py @@ -703,7 +703,7 @@ ))
-class Foo(object): +class Foo:
"""Test class to verify classproperty decorator."""
diff --git a/tests/utils.py b/tests/utils.py index ef024c5..08f2d11 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -174,7 +174,7 @@ return log
-class AssertAPIErrorContextManager(object): +class AssertAPIErrorContextManager:
""" Context manager to assert certain APIError exceptions. @@ -242,7 +242,7 @@ return {'name': name, 'limit': None}
-class DummySiteinfo(object): +class DummySiteinfo:
"""Dummy class to use instead of L{pywikibot.site.Siteinfo}."""
pywikibot-commits@lists.wikimedia.org