Stop sub-classing object (#8249)

This commit is contained in:
Patrick Cloke 2020-09-04 06:54:56 -04:00 committed by GitHub
parent 9f8abdcc38
commit c619253db8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
168 changed files with 293 additions and 292 deletions

View file

@ -96,7 +96,7 @@ class DefaultDictProperty(DictProperty):
return instance._dict.get(self.key, self.default)
class _EventInternalMetadata(object):
class _EventInternalMetadata:
__slots__ = ["_dict"]
def __init__(self, internal_metadata_dict: JsonDict):

View file

@ -36,7 +36,7 @@ from synapse.util.stringutils import random_string
@attr.s(slots=True, cmp=False, frozen=True)
class EventBuilder(object):
class EventBuilder:
"""A format independent event builder used to build up the event content
before signing the event.
@ -164,7 +164,7 @@ class EventBuilder(object):
)
class EventBuilderFactory(object):
class EventBuilderFactory:
def __init__(self, hs):
self.clock = hs.get_clock()
self.hostname = hs.hostname

View file

@ -25,7 +25,7 @@ if MYPY:
import synapse.server
class SpamChecker(object):
class SpamChecker:
def __init__(self, hs: "synapse.server.HomeServer"):
self.spam_checkers = [] # type: List[Any]

View file

@ -18,7 +18,7 @@ from synapse.events.snapshot import EventContext
from synapse.types import Requester
class ThirdPartyEventRules(object):
class ThirdPartyEventRules:
"""Allows server admins to provide a Python module implementing an extra
set of rules to apply when processing events.

View file

@ -322,7 +322,7 @@ def serialize_event(
return d
class EventClientSerializer(object):
class EventClientSerializer:
"""Serializes events that are to be sent to clients.
This is used for bundling extra information with any events to be sent to

View file

@ -20,7 +20,7 @@ from synapse.events.utils import validate_canonicaljson
from synapse.types import EventID, RoomID, UserID
class EventValidator(object):
class EventValidator:
def validate_new(self, event, config):
"""Validates the event has roughly the right format