File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ Extending :class:`JSONEncoder`::
106
106
... if isinstance(obj, complex):
107
107
... return [obj.real, obj.imag]
108
108
... # Let the base class default method raise the TypeError
109
- ... return json.JSONEncoder. default(self, obj)
109
+ ... return super(). default(obj)
110
110
...
111
111
>>> json.dumps(2 + 1j, cls=ComplexEncoder)
112
112
'[2.0, 1.0]'
@@ -504,7 +504,7 @@ Encoders and Decoders
504
504
else:
505
505
return list(iterable)
506
506
# Let the base class default method raise the TypeError
507
- return json.JSONEncoder. default(self, o)
507
+ return super(). default(o)
508
508
509
509
510
510
.. method :: encode(o)
Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ def default(self, o):
174
174
else:
175
175
return list(iterable)
176
176
# Let the base class default method raise the TypeError
177
- return JSONEncoder .default(self, o)
177
+ return super() .default(o)
178
178
179
179
"""
180
180
raise TypeError (f'Object of type { o .__class__ .__name__ } '
You can’t perform that action at this time.
0 commit comments