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

Skip to content

Commit aeb46ca

Browse files
committed
Do not inherit from object
1 parent 6f1ffeb commit aeb46ca

Some content is hidden

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

79 files changed

+176
-176
lines changed

lib/matplotlib/_layoutbox.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def get_renderer(fig):
4343
return renderer
4444

4545

46-
class LayoutBox(object):
46+
class LayoutBox:
4747
"""
4848
Basic rectangle representation using kiwi solver variables
4949
"""

lib/matplotlib/_pylab_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import gc
77

88

9-
class Gcf(object):
9+
class Gcf:
1010
"""
1111
Singleton to manage a set of integer-numbered figures.
1212

lib/matplotlib/afm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ def _parse_afm(fh):
393393
return header, cmetrics_by_ascii, cmetrics_by_name, kernpairs, composites
394394

395395

396-
class AFM(object):
396+
class AFM:
397397

398398
def __init__(self, fh):
399399
"""Parse the AFM file in file object *fh*."""

lib/matplotlib/animation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def correct_roundoff(x, dpi, n):
9393

9494

9595
# A registry for available MovieWriter classes
96-
class MovieWriterRegistry(object):
96+
class MovieWriterRegistry:
9797
'''Registry of available writer classes by human readable name.'''
9898
def __init__(self):
9999
self.avail = dict()
@@ -576,7 +576,7 @@ def finish(self):
576576

577577
# Base class of ffmpeg information. Has the config keys and the common set
578578
# of arguments that controls the *output* side of things.
579-
class FFMpegBase(object):
579+
class FFMpegBase:
580580
'''Mixin class for FFMpeg output.
581581
582582
To be useful this must be multiply-inherited from with a
@@ -696,7 +696,7 @@ class AVConvFileWriter(AVConvBase, FFMpegFileWriter):
696696

697697

698698
# Base class for animated GIFs with ImageMagick
699-
class ImageMagickBase(object):
699+
class ImageMagickBase:
700700
'''Mixin class for ImageMagick output.
701701
702702
To be useful this must be multiply-inherited from with a
@@ -880,7 +880,7 @@ def finish(self):
880880
**mode_dict))
881881

882882

883-
class Animation(object):
883+
class Animation:
884884
'''This class wraps the creation of an animation using matplotlib.
885885
886886
It is only a base class which should be subclassed to provide

lib/matplotlib/artist.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def _stale_axes_callback(self, val):
5454
_XYPair = namedtuple("_XYPair", "x y")
5555

5656

57-
class Artist(object):
57+
class Artist:
5858
"""
5959
Abstract base class for objects that render into a FigureCanvas.
6060
@@ -1168,7 +1168,7 @@ def mouseover(self, val):
11681168
ax._mouseover_set.discard(self)
11691169

11701170

1171-
class ArtistInspector(object):
1171+
class ArtistInspector:
11721172
"""
11731173
A helper class to inspect an `~matplotlib.artist.Artist` and return
11741174
information about its settable properties and their current values.

lib/matplotlib/axes/_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def _process_plot_format(fmt):
114114
return linestyle, marker, color
115115

116116

117-
class _process_plot_var_args(object):
117+
class _process_plot_var_args:
118118
"""
119119
Process variable length arguments to the plot command, so that
120120
plot commands like the following are supported::

lib/matplotlib/axes/_subplots.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import matplotlib._layoutbox as layoutbox
99

1010

11-
class SubplotBase(object):
11+
class SubplotBase:
1212
"""
1313
Base class for subplots, which are :class:`Axes` instances with
1414
additional methods to facilitate generating and manipulating a set

lib/matplotlib/axis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ def get_view_interval(self):
628628
return self.axes.viewLim.intervaly
629629

630630

631-
class Ticker(object):
631+
class Ticker:
632632
"""
633633
A container for the objects defining tick position and format.
634634
@@ -671,7 +671,7 @@ def formatter(self, formatter):
671671
self._formatter = formatter
672672

673673

674-
class _LazyTickList(object):
674+
class _LazyTickList:
675675
"""
676676
A descriptor for lazy instantiation of tick lists.
677677

lib/matplotlib/backend_bases.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def get_registered_canvas_class(format):
127127
return backend_class
128128

129129

130-
class RendererBase(object):
130+
class RendererBase:
131131
"""An abstract base class to handle drawing/rendering operations.
132132
133133
The following methods must be implemented in the backend for full
@@ -712,7 +712,7 @@ def stop_filter(self, filter_func):
712712
"""
713713

714714

715-
class GraphicsContextBase(object):
715+
class GraphicsContextBase:
716716
"""An abstract base class that provides color, line styles, etc."""
717717

718718
def __init__(self):
@@ -1032,7 +1032,7 @@ def set_sketch_params(self, scale=None, length=None, randomness=None):
10321032
else (scale, length or 128., randomness or 16.))
10331033

10341034

1035-
class TimerBase(object):
1035+
class TimerBase:
10361036
"""
10371037
A base class for providing timer events, useful for things animations.
10381038
Backends need to implement a few specific methods in order to use their
@@ -1203,7 +1203,7 @@ def _on_timer(self):
12031203
self.stop()
12041204

12051205

1206-
class Event(object):
1206+
class Event:
12071207
"""
12081208
A matplotlib event. Attach additional attributes as defined in
12091209
:meth:`FigureCanvasBase.mpl_connect`. The following attributes
@@ -1552,7 +1552,7 @@ def _draw(renderer): raise Done(renderer)
15521552
return figure._cachedRenderer
15531553

15541554

1555-
class FigureCanvasBase(object):
1555+
class FigureCanvasBase:
15561556
"""
15571557
The canvas the figure renders into.
15581558
@@ -2466,7 +2466,7 @@ class NonGuiException(Exception):
24662466
pass
24672467

24682468

2469-
class FigureManagerBase(object):
2469+
class FigureManagerBase:
24702470
"""
24712471
Helper class for pyplot mode, wraps everything up into a neat bundle
24722472
@@ -2567,7 +2567,7 @@ def set_window_title(self, title):
25672567
cursors = tools.cursors
25682568

25692569

2570-
class NavigationToolbar2(object):
2570+
class NavigationToolbar2:
25712571
"""
25722572
Base class for the navigation cursor, version 2
25732573
@@ -3079,7 +3079,7 @@ def set_history_buttons(self):
30793079
"""Enable or disable the back/forward button."""
30803080

30813081

3082-
class ToolContainerBase(object):
3082+
class ToolContainerBase:
30833083
"""
30843084
Base class for all tool containers, e.g. toolbars.
30853085
@@ -3223,7 +3223,7 @@ def remove_toolitem(self, name):
32233223
raise NotImplementedError
32243224

32253225

3226-
class StatusbarBase(object):
3226+
class StatusbarBase:
32273227
"""Base class for the statusbar"""
32283228
def __init__(self, toolmanager):
32293229
self.toolmanager = toolmanager
@@ -3246,7 +3246,7 @@ def set_message(self, s):
32463246
pass
32473247

32483248

3249-
class _Backend(object):
3249+
class _Backend:
32503250
# A backend can be defined by using the following pattern:
32513251
#
32523252
# @_Backend.export

lib/matplotlib/backend_managers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
_log = logging.getLogger(__name__)
99

1010

11-
class ToolEvent(object):
11+
class ToolEvent:
1212
"""Event for tool manipulation (add/remove)."""
1313
def __init__(self, name, sender, tool, data=None):
1414
self.name = name
@@ -24,7 +24,7 @@ def __init__(self, name, sender, tool, canvasevent=None, data=None):
2424
self.canvasevent = canvasevent
2525

2626

27-
class ToolManagerMessageEvent(object):
27+
class ToolManagerMessageEvent:
2828
"""
2929
Event carrying messages from toolmanager.
3030
@@ -36,7 +36,7 @@ def __init__(self, name, sender, message):
3636
self.message = message
3737

3838

39-
class ToolManager(object):
39+
class ToolManager:
4040
"""
4141
Manager for actions triggered by user interactions (key press, toolbar
4242
clicks, ...) on a Figure.

lib/matplotlib/backend_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Cursors(IntEnum): # Must subclass int for the macOS backend.
3636
_views_positions = 'viewpos'
3737

3838

39-
class ToolBase(object):
39+
class ToolBase:
4040
"""
4141
Base tool class
4242

lib/matplotlib/backends/_backend_tk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ def update(self):
645645
NavigationToolbar2.update(self)
646646

647647

648-
class ToolTip(object):
648+
class ToolTip:
649649
"""
650650
Tooltip recipe from
651651
http://www.voidspace.org.uk/python/weblog/arch_d7_2006_07_01.shtml#e387

lib/matplotlib/backends/backend_mixed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from matplotlib.tight_bbox import process_figure_for_rasterizing
55

66

7-
class MixedModeRenderer(object):
7+
class MixedModeRenderer:
88
"""
99
A helper class to implement a renderer that switches between
1010
vector and raster drawing. An example may be a PDF writer, where

lib/matplotlib/backends/backend_nbagg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def new_timer(self, *args, **kwargs):
148148
return TimerTornado(*args, **kwargs)
149149

150150

151-
class CommSocket(object):
151+
class CommSocket:
152152
"""
153153
Manages the Comm connection between IPython and the browser (client).
154154

lib/matplotlib/backends/backend_pdf.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def pdfRepr(obj):
223223
.format(type(obj)))
224224

225225

226-
class Reference(object):
226+
class Reference:
227227
"""PDF reference object.
228228
Use PdfFile.reserveObject() to create References.
229229
"""
@@ -245,7 +245,7 @@ def write(self, contents, file):
245245

246246

247247
@total_ordering
248-
class Name(object):
248+
class Name:
249249
"""PDF name object."""
250250
__slots__ = ('name',)
251251
_regex = re.compile(r'[^!-~]')
@@ -281,7 +281,7 @@ def pdfRepr(self):
281281
return b'/' + self.name
282282

283283

284-
class Operator(object):
284+
class Operator:
285285
"""PDF operator object."""
286286
__slots__ = ('op',)
287287

@@ -295,7 +295,7 @@ def pdfRepr(self):
295295
return self.op
296296

297297

298-
class Verbatim(object):
298+
class Verbatim:
299299
"""Store verbatim PDF command content for later inclusion in the
300300
stream."""
301301
def __init__(self, x):
@@ -339,7 +339,7 @@ def _paint_path(fill, stroke):
339339
Op.paint_path = _paint_path
340340

341341

342-
class Stream(object):
342+
class Stream:
343343
"""PDF stream object.
344344
345345
This has no pdfRepr method. Instead, call begin(), then output the
@@ -420,7 +420,7 @@ def _flush(self):
420420
self.compressobj = None
421421

422422

423-
class PdfFile(object):
423+
class PdfFile:
424424
"""PDF file object."""
425425

426426
def __init__(self, filename, metadata=None):
@@ -2324,7 +2324,7 @@ def finalize(self):
23242324
########################################################################
23252325

23262326

2327-
class PdfPages(object):
2327+
class PdfPages:
23282328
"""
23292329
A multi-page PDF file.
23302330

lib/matplotlib/backends/backend_ps.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
debugPS = 0
4343

4444

45-
class PsBackendHelper(object):
45+
class PsBackendHelper:
4646

4747
def __init__(self):
4848
self._cached = {}
@@ -950,7 +950,7 @@ def _print_figure(
950950
self.figure.set_edgecolor(edgecolor)
951951

952952
if dryrun:
953-
class NullWriter(object):
953+
class NullWriter:
954954
def write(self, *args, **kwargs):
955955
pass
956956

@@ -1148,7 +1148,7 @@ def _print_figure_tex(
11481148
self.figure.set_edgecolor(edgecolor)
11491149

11501150
if dryrun:
1151-
class NullWriter(object):
1151+
class NullWriter:
11521152
def write(self, *args, **kwargs):
11531153
pass
11541154

lib/matplotlib/backends/backend_svg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def short_float_fmt(x):
9696
return '{0:f}'.format(x).rstrip('0').rstrip('.')
9797

9898

99-
class XMLWriter(object):
99+
class XMLWriter:
100100
"""
101101
Parameters
102102
----------

lib/matplotlib/backends/backend_wx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def debug_on_error(type, value, tb):
5757

5858

5959
@cbook.deprecated("3.1")
60-
class fake_stderr(object):
60+
class fake_stderr:
6161
"""
6262
Wx does strange things with stderr, as it makes the assumption that
6363
there is probably no console. This redirects stderr to the console, since

lib/matplotlib/bezier.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def find_bezier_t_intersecting_with_closedpath(
145145
start_inside = middle_inside
146146

147147

148-
class BezierSegment(object):
148+
class BezierSegment:
149149
"""
150150
A simple class of a 2-dimensional bezier segment
151151
"""

lib/matplotlib/blocking_input.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
_log = logging.getLogger(__name__)
2828

2929

30-
class BlockingInput(object):
30+
class BlockingInput:
3131
"""Callable for retrieving events in a blocking way."""
3232

3333
def __init__(self, fig, eventslist=()):

0 commit comments

Comments
 (0)