Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit c619253

Browse files
authored
Stop sub-classing object (#8249)
1 parent 9f8abdc commit c619253

File tree

168 files changed

+293
-292
lines changed

Some content is hidden

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

168 files changed

+293
-292
lines changed

changelog.d/8249.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Stop sub-classing from object.

contrib/cmdclient/http.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from twisted.web.http_headers import Headers
2525

2626

27-
class HttpClient(object):
27+
class HttpClient:
2828
""" Interface for talking json over http
2929
"""
3030

@@ -169,7 +169,7 @@ def sleep(self, seconds):
169169
return d
170170

171171

172-
class _RawProducer(object):
172+
class _RawProducer:
173173
def __init__(self, data):
174174
self.data = data
175175
self.body = data
@@ -186,7 +186,7 @@ def stopProducing(self):
186186
pass
187187

188188

189-
class _JsonProducer(object):
189+
class _JsonProducer:
190190
""" Used by the twisted http client to create the HTTP body from json
191191
"""
192192

contrib/experiments/cursesio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def close(self):
141141
curses.endwin()
142142

143143

144-
class Callback(object):
144+
class Callback:
145145
def __init__(self, stdio):
146146
self.stdio = stdio
147147

contrib/experiments/test_messaging.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def excpetion_errback(failure):
5555
logging.exception(failure)
5656

5757

58-
class InputOutput(object):
58+
class InputOutput:
5959
""" This is responsible for basic I/O so that a user can interact with
6060
the example app.
6161
"""
@@ -132,7 +132,7 @@ def emit(self, record):
132132
self.io.print_log(msg)
133133

134134

135-
class Room(object):
135+
class Room:
136136
""" Used to store (in memory) the current membership state of a room, and
137137
which home servers we should send PDUs associated with the room to.
138138
"""

scripts-dev/hash_history.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from synapse.storage.signatures import SignatureStore
1616

1717

18-
class Store(object):
18+
class Store:
1919
_get_pdu_tuples = PduStore.__dict__["_get_pdu_tuples"]
2020
_get_pdu_content_hashes_txn = SignatureStore.__dict__["_get_pdu_content_hashes_txn"]
2121
_get_prev_pdu_hashes_txn = SignatureStore.__dict__["_get_prev_pdu_hashes_txn"]

synapse/api/auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class _InvalidMacaroonException(Exception):
5858
pass
5959

6060

61-
class Auth(object):
61+
class Auth:
6262
"""
6363
FIXME: This class contains a mix of functions for authenticating users
6464
of our client-server API and authenticating events added to room graphs.

synapse/api/auth_blocking.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
logger = logging.getLogger(__name__)
2323

2424

25-
class AuthBlocking(object):
25+
class AuthBlocking:
2626
def __init__(self, hs):
2727
self.store = hs.get_datastore()
2828

synapse/api/constants.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
MAX_USERID_LENGTH = 255
2929

3030

31-
class Membership(object):
31+
class Membership:
3232

3333
"""Represents the membership states of a user in a room."""
3434

@@ -40,22 +40,22 @@ class Membership(object):
4040
LIST = (INVITE, JOIN, KNOCK, LEAVE, BAN)
4141

4242

43-
class PresenceState(object):
43+
class PresenceState:
4444
"""Represents the presence state of a user."""
4545

4646
OFFLINE = "offline"
4747
UNAVAILABLE = "unavailable"
4848
ONLINE = "online"
4949

5050

51-
class JoinRules(object):
51+
class JoinRules:
5252
PUBLIC = "public"
5353
KNOCK = "knock"
5454
INVITE = "invite"
5555
PRIVATE = "private"
5656

5757

58-
class LoginType(object):
58+
class LoginType:
5959
PASSWORD = "m.login.password"
6060
EMAIL_IDENTITY = "m.login.email.identity"
6161
MSISDN = "m.login.msisdn"
@@ -65,7 +65,7 @@ class LoginType(object):
6565
DUMMY = "m.login.dummy"
6666

6767

68-
class EventTypes(object):
68+
class EventTypes:
6969
Member = "m.room.member"
7070
Create = "m.room.create"
7171
Tombstone = "m.room.tombstone"
@@ -96,17 +96,17 @@ class EventTypes(object):
9696
Presence = "m.presence"
9797

9898

99-
class RejectedReason(object):
99+
class RejectedReason:
100100
AUTH_ERROR = "auth_error"
101101

102102

103-
class RoomCreationPreset(object):
103+
class RoomCreationPreset:
104104
PRIVATE_CHAT = "private_chat"
105105
PUBLIC_CHAT = "public_chat"
106106
TRUSTED_PRIVATE_CHAT = "trusted_private_chat"
107107

108108

109-
class ThirdPartyEntityKind(object):
109+
class ThirdPartyEntityKind:
110110
USER = "user"
111111
LOCATION = "location"
112112

@@ -115,7 +115,7 @@ class ThirdPartyEntityKind(object):
115115
ServerNoticeLimitReached = "m.server_notice.usage_limit_reached"
116116

117117

118-
class UserTypes(object):
118+
class UserTypes:
119119
"""Allows for user type specific behaviour. With the benefit of hindsight
120120
'admin' and 'guest' users should also be UserTypes. Normal users are type None
121121
"""
@@ -125,7 +125,7 @@ class UserTypes(object):
125125
ALL_USER_TYPES = (SUPPORT, BOT)
126126

127127

128-
class RelationTypes(object):
128+
class RelationTypes:
129129
"""The types of relations known to this server.
130130
"""
131131

@@ -134,14 +134,14 @@ class RelationTypes(object):
134134
REFERENCE = "m.reference"
135135

136136

137-
class LimitBlockingTypes(object):
137+
class LimitBlockingTypes:
138138
"""Reasons that a server may be blocked"""
139139

140140
MONTHLY_ACTIVE_USER = "monthly_active_user"
141141
HS_DISABLED = "hs_disabled"
142142

143143

144-
class EventContentFields(object):
144+
class EventContentFields:
145145
"""Fields found in events' content, regardless of type."""
146146

147147
# Labels for the event, cf https://github.com/matrix-org/matrix-doc/pull/2326
@@ -152,6 +152,6 @@ class EventContentFields(object):
152152
SELF_DESTRUCT_AFTER = "org.matrix.self_destruct_after"
153153

154154

155-
class RoomEncryptionAlgorithms(object):
155+
class RoomEncryptionAlgorithms:
156156
MEGOLM_V1_AES_SHA2 = "m.megolm.v1.aes-sha2"
157157
DEFAULT = MEGOLM_V1_AES_SHA2

synapse/api/errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
logger = logging.getLogger(__name__)
3232

3333

34-
class Codes(object):
34+
class Codes:
3535
UNRECOGNIZED = "M_UNRECOGNIZED"
3636
UNAUTHORIZED = "M_UNAUTHORIZED"
3737
FORBIDDEN = "M_FORBIDDEN"

synapse/api/filtering.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def matrix_user_id_validator(user_id_str):
130130
return UserID.from_string(user_id_str)
131131

132132

133-
class Filtering(object):
133+
class Filtering:
134134
def __init__(self, hs):
135135
super(Filtering, self).__init__()
136136
self.store = hs.get_datastore()
@@ -168,7 +168,7 @@ def check_valid_filter(self, user_filter_json):
168168
raise SynapseError(400, str(e))
169169

170170

171-
class FilterCollection(object):
171+
class FilterCollection:
172172
def __init__(self, filter_json):
173173
self._filter_json = filter_json
174174

@@ -249,7 +249,7 @@ def blocks_all_room_timeline(self):
249249
)
250250

251251

252-
class Filter(object):
252+
class Filter:
253253
def __init__(self, filter_json):
254254
self.filter_json = filter_json
255255

0 commit comments

Comments
 (0)