diff --git a/wagtail/admin/rich_text/converters/contentstate_models.py b/wagtail/admin/rich_text/converters/contentstate_models.py index b8d12bb4e1..c1c3d85a3a 100644 --- a/wagtail/admin/rich_text/converters/contentstate_models.py +++ b/wagtail/admin/rich_text/converters/contentstate_models.py @@ -5,7 +5,7 @@ import string ALPHANUM = string.ascii_lowercase + string.digits -class Block(object): +class Block: def __init__(self, typ, depth=0): self.type = typ self.depth = depth @@ -25,7 +25,7 @@ class Block(object): } -class InlineStyleRange(object): +class InlineStyleRange: def __init__(self, style): self.style = style self.offset = None @@ -39,7 +39,7 @@ class InlineStyleRange(object): } -class Entity(object): +class Entity: def __init__(self, entity_type, mutability, data): self.entity_type = entity_type self.mutability = mutability @@ -53,7 +53,7 @@ class Entity(object): } -class EntityRange(object): +class EntityRange: def __init__(self, key): self.key = key self.offset = None @@ -67,7 +67,7 @@ class EntityRange(object): } -class ContentState(object): +class ContentState: """Pythonic representation of a draft.js contentState structure""" def __init__(self): self.blocks = [] diff --git a/wagtail/search/tests/test_page_search.py b/wagtail/search/tests/test_page_search.py index 4ab4c56941..53ac110ffa 100644 --- a/wagtail/search/tests/test_page_search.py +++ b/wagtail/search/tests/test_page_search.py @@ -7,7 +7,7 @@ from wagtail.core.models import Page from wagtail.search.backends import get_search_backend -class PageSearchTests(object): +class PageSearchTests: # A TestCase with this class mixed in will be dynamically created # for each search backend defined in WAGTAILSEARCH_BACKENDS, with the backend name available # as self.backend_name diff --git a/wagtail/utils/deprecation.py b/wagtail/utils/deprecation.py index 76811c86fa..90c118eff1 100644 --- a/wagtail/utils/deprecation.py +++ b/wagtail/utils/deprecation.py @@ -13,7 +13,7 @@ class RemovedInWagtail29Warning(PendingDeprecationWarning): pass -class MovedDefinitionHandler(object): +class MovedDefinitionHandler: """ A wrapper for module objects to enable definitions to be moved to a new module, with a deprecation path for the old location. Importing the name from the old location will diff --git a/wagtail/utils/l18n/translation.py b/wagtail/utils/l18n/translation.py index 242d53aa49..1ae66510df 100644 --- a/wagtail/utils/l18n/translation.py +++ b/wagtail/utils/l18n/translation.py @@ -8,7 +8,7 @@ from copy import copy, deepcopy import six -class Trans(object): +class Trans: def __init__(self): self.registry = {} @@ -73,7 +73,7 @@ else: return s -class L18NLazyObject(object): +class L18NLazyObject: def _value(self, utf8=True): raise NotImplementedError