Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 730c5a7

Browse files
committed
Use super() in various remaining classes.
1 parent 92d7b7a commit 730c5a7

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

examples/units/basic_units.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def __call__(self, *args):
4343

4444
class ConvertArgsProxy(PassThroughProxy):
4545
def __init__(self, fn_name, obj):
46-
PassThroughProxy.__init__(self, fn_name, obj)
46+
super().__init__(fn_name, obj)
4747
self.unit = obj.unit
4848

4949
def __call__(self, *args):
@@ -54,23 +54,23 @@ def __call__(self, *args):
5454
except AttributeError:
5555
converted_args.append(TaggedValue(a, self.unit))
5656
converted_args = tuple([c.get_value() for c in converted_args])
57-
return PassThroughProxy.__call__(self, *converted_args)
57+
return super().__call__(*converted_args)
5858

5959

6060
class ConvertReturnProxy(PassThroughProxy):
6161
def __init__(self, fn_name, obj):
62-
PassThroughProxy.__init__(self, fn_name, obj)
62+
super().__init__(fn_name, obj)
6363
self.unit = obj.unit
6464

6565
def __call__(self, *args):
66-
ret = PassThroughProxy.__call__(self, *args)
66+
ret = super().__call__(*args)
6767
return (NotImplemented if ret is NotImplemented
6868
else TaggedValue(ret, self.unit))
6969

7070

7171
class ConvertAllProxy(PassThroughProxy):
7272
def __init__(self, fn_name, obj):
73-
PassThroughProxy.__init__(self, fn_name, obj)
73+
super().__init__(fn_name, obj)
7474
self.unit = obj.unit
7575

7676
def __call__(self, *args):
@@ -96,7 +96,7 @@ def __call__(self, *args):
9696
else:
9797
arg_units.append(None)
9898
converted_args = tuple(converted_args)
99-
ret = PassThroughProxy.__call__(self, *converted_args)
99+
ret = super().__call__(*converted_args)
100100
if ret is NotImplemented:
101101
return NotImplemented
102102
ret_unit = unit_resolver(self.fn_name, arg_units)

lib/matplotlib/gridspec.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,9 @@ def __init__(self, nrows, ncols, figure=None,
438438
self.hspace = hspace
439439
self.figure = figure
440440

441-
GridSpecBase.__init__(self, nrows, ncols,
442-
width_ratios=width_ratios,
443-
height_ratios=height_ratios)
441+
super().__init__(nrows, ncols,
442+
width_ratios=width_ratios,
443+
height_ratios=height_ratios)
444444

445445
if self.figure is None or not self.figure.get_constrained_layout():
446446
self._layoutbox = None
@@ -583,9 +583,9 @@ def __init__(self, nrows, ncols,
583583
self._hspace = hspace
584584
self._subplot_spec = subplot_spec
585585
self.figure = self._subplot_spec.get_gridspec().figure
586-
GridSpecBase.__init__(self, nrows, ncols,
587-
width_ratios=width_ratios,
588-
height_ratios=height_ratios)
586+
super().__init__(nrows, ncols,
587+
width_ratios=width_ratios,
588+
height_ratios=height_ratios)
589589
# do the layoutboxes
590590
subspeclb = subplot_spec._layoutbox
591591
if subspeclb is None:

lib/matplotlib/image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,7 @@ def set_interpolation(self, s):
11041104
if s is not None and s not in ('nearest', 'bilinear'):
11051105
raise NotImplementedError('Only nearest neighbor and '
11061106
'bilinear interpolations are supported')
1107-
AxesImage.set_interpolation(self, s)
1107+
super().set_interpolation(s)
11081108

11091109
def get_extent(self):
11101110
if self._A is None:

lib/matplotlib/quiver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ def __init__(self, Q, X, Y, U, label,
249249
Any additional keyword arguments are used to override vector
250250
properties taken from *Q*.
251251
"""
252-
martist.Artist.__init__(self)
252+
super().__init__()
253253
self.Q = Q
254254
self.X = X
255255
self.Y = Y
@@ -360,7 +360,7 @@ def _set_transform(self):
360360
}, coordinates=self.coord))
361361

362362
def set_figure(self, fig):
363-
martist.Artist.set_figure(self, fig)
363+
super().set_figure(fig)
364364
self.text.set_figure(fig)
365365

366366
def contains(self, mouseevent):

lib/matplotlib/table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def __init__(self, ax, loc=None, bbox=None, **kwargs):
289289
`.Artist` properties.
290290
"""
291291

292-
Artist.__init__(self)
292+
super().__init__()
293293

294294
if isinstance(loc, str):
295295
if loc not in self.codes:

lib/mpl_toolkits/axes_grid1/axes_divider.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ def __init__(self, fig, *args, horizontal=None, vertical=None,
349349
self.figure = fig
350350
self._subplotspec = SubplotSpec._from_subplot_args(fig, args)
351351
self.update_params() # sets self.figbox
352-
Divider.__init__(self, fig, pos=self.figbox.bounds,
352+
super().__init__(fig, pos=self.figbox.bounds,
353353
horizontal=horizontal or [], vertical=vertical or [],
354354
aspect=aspect, anchor=anchor)
355355

@@ -406,7 +406,7 @@ def __init__(self, axes, xref=None, yref=None):
406406
else:
407407
self._yref = yref
408408

409-
Divider.__init__(self, fig=axes.get_figure(), pos=None,
409+
super().__init__(fig=axes.get_figure(), pos=None,
410410
horizontal=[self._xref], vertical=[self._yref],
411411
aspect=None, anchor="C")
412412

0 commit comments

Comments
 (0)