8000 Remove explicit inheritance from object by timhoffm · Pull Request #14328 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Remove explicit inheritance from object #14328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/matplotlib/_layoutbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def get_renderer(fig):
return renderer


class LayoutBox(object):
class LayoutBox:
"""
Basic rectangle representation using kiwi solver variables
"""
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/_pylab_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import gc


class Gcf(object):
class Gcf:
"""
Singleton to manage a set of integer-numbered figures.

Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/afm.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def _parse_afm(fh):
return header, cmetrics_by_ascii, cmetrics_by_name, kernpairs, composites


class AFM(object):
class AFM:

def __init__(self, fh):
"""Parse the AFM file in file object *fh*."""
Expand Down
8 changes: 4 additions & 4 deletions lib/matplotlib/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def correct_roundoff(x, dpi, n):


# A registry for available MovieWriter classes
class MovieWriterRegistry(object):
class MovieWriterRegistry:
'''Registry of available writer classes by human readable name.'''
def __init__(self):
self.avail = dict()
Expand Down Expand Up @@ -576,7 +576,7 @@ def finish(self):

# Base class of ffmpeg information. Has the config keys and the common set
# of arguments that controls the *output* side of things.
class FFMpegBase(object):
class FFMpegBase:
'''Mixin class for FFMpeg output.

To be useful this must be multiply-inherited from with a
Expand Down Expand Up @@ -696,7 +696,7 @@ class AVConvFileWriter(AVConvBase, FFMpegFileWriter):


# Base class for animated GIFs with ImageMagick
class ImageMagickBase(object):
class ImageMagickBase:
'''Mixin class for ImageMagick output.

To be useful this must be multiply-inherited from with a
Expand Down Expand Up @@ -880,7 +880,7 @@ def finish(self):
**mode_dict))


class Animation(object):
class Animation:
'''This class wraps the creation of an animation using matplotlib.

It is only a base class which should be subclassed to provide
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/artist.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def _stale_axes_callback(self, val):
_XYPair = namedtuple("_XYPair", "x y")


class Artist(object):
class Artist:
"""
Abstract base class for objects that render into a FigureCanvas.

10000 Expand Down Expand Up @@ -1168,7 +1168,7 @@ def mouseover(self, val):
ax._mouseover_set.discard(self)


class ArtistInspector(object):
class ArtistInspector:
"""
A helper class to inspect an `~matplotlib.artist.Artist` and return
information about its settable properties and their current values.
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def _process_plot_format(fmt):
return linestyle, marker, color


class _process_plot_var_args(object):
class _process_plot_var_args:
"""
Process variable length arguments to the plot command, so that
plot commands like the following are supported::
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/axes/_subplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import matplotlib._layoutbox as layoutbox


class SubplotBase(object):
class SubplotBase:
"""
Base class for subplots, which are :class:`Axes` instances with
additional methods to facilitate generating and manipulating a set
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ def get_view_interval(self):
return self.axes.viewLim.intervaly


class Ticker(object):
class Ticker:
"""
A container for the objects defining tick position and format.

Expand Down Expand Up @@ -671,7 +671,7 @@ def formatter(self, formatter):
self._formatter = formatter


class _LazyTickList(object):
class _LazyTickList:
"""
A descriptor for lazy instantiation of tick lists.

Expand Down
20 changes: 10 additions & 10 deletions lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def get_registered_canvas_class(format):
return backend_class


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


class GraphicsContextBase(object):
class GraphicsContextBase:
"""An abstract base class that provides color, line styles, etc."""

def __init__(self):
Expand Down Expand Up @@ -1032,7 +1032,7 @@ def set_sketch_params(self, scale=None, length=None, randomness=None):
else (scale, length or 128., randomness or 16.))


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


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


class FigureCanvasBase(object):
class FigureCanvasBase:
"""
The canvas the figure renders into.
Expand Down Expand Up @@ -2466,7 +2466,7 @@ class NonGuiException(Exception):
pass


class FigureManagerBase(object):
class FigureManagerBase:
"""
Helper class for pyplot mode, wraps everything up into a neat bundle
Expand Down Expand Up @@ -2567,7 +2567,7 @@ def set_window_title(self, title):
cursors = tools.cursors


class NavigationToolbar2(object):
class NavigationToolbar2:
"""
Base class for the navigation cursor, version 2
Expand Down Expand Up @@ -3079,7 +3079,7 @@ def set_history_buttons(self):
"""Enable or disable the back/forward button."""


class ToolContainerBase(object):
class ToolContainerBase:
"""
Base class for all tool containers, e.g. toolbars.
Expand Down Expand Up @@ -3223,7 +3223,7 @@ def remove_toolitem(self, name):
raise NotImplementedError


class StatusbarBase(object):
class StatusbarBase:
"""Base class for the statusbar"""
def __init__(self, toolmanager):
self.toolmanager = toolmanager
Expand All @@ -3246,7 +3246,7 @@ def set_message(self, s):
pass


class _Backend(object):
class _Backend:
# A backend can be defined by using the following pattern:
#
# @_Backend.export
Expand Down
6 changes: 3 additions & 3 deletions lib/matplotlib/backend_managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
_log = logging.getLogger(__name__)


class ToolEvent(object):
class ToolEvent:
"""Event for tool manipulation (add/remove)."""
def __init__(self, name, sender, tool, data=None):
self.name = name
Expand All @@ -24,7 +24,7 @@ def __init__(self, name, sender, tool, canvasevent=None, data=None):
self.canvasevent = canvasevent


class ToolManagerMessageEvent(object):
class ToolManagerMessageEvent:
"""
Event carrying messages from toolmanager.

Expand All @@ -36,7 +36,7 @@ def __init__(self, name, sender, message):
self.message = message


class ToolManager(object):
class ToolManager:
"""
Manager for actions triggered by user interactions (key press, toolbar
clicks, ...) on a Figure.
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/backend_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Cursors(IntEnum): # Must subclass int for the macOS backend.
_views_positions = 'viewpos'


class ToolBase(object):
class ToolBase:
"""
Base tool class

Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/backends/_backend_tk.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ def update(self):
NavigationToolbar2.update(self)


class ToolTip(object):
class ToolTip:
"""
Tooltip recipe from
http://www.voidspace.org.uk/python/weblog/arch_d7_2006_07_01.shtml#e387
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/backends/backend_mixed.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from matplotlib.tight_bbox import process_figure_for_rasterizing


class MixedModeRenderer(object):
class MixedModeRenderer:
"""
A helper class to implement a renderer that switches between
vector and raster drawing. An example may be a PDF writer, where
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/backends/backend_nbagg.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def new_timer(self, *args, **kwargs):
return TimerTornado(*args, **kwargs)


class CommSocket(object):
class CommSocket:
"""
Manages the Comm connection between IPython and the browser (client).

Expand Down
14 changes: 7 additions & 7 deletions lib/matplotlib/backends/backend_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def pdfRepr(obj):
.format(type(obj)))


class Reference(object):
class Reference:
"""PDF reference object.
Use PdfFile.reserveObject() to create References.
"""
Expand All @@ -245,7 +245,7 @@ def write(self, contents, file):


@total_ordering
class Name(object):
class Name:
"""PDF name object."""
__slots__ = ('name',)
_regex = re.compile(r'[^!-~]')
Expand Down Expand Up @@ -281,7 +281,7 @@ def pdfRepr(self):
return b'/' + self.name


class Operator(object):
class Operator:
"""PDF operator object."""
__slots__ = ('op',)

Expand All @@ -295,7 +295,7 @@ def pdfRepr(self):
return self.op


class Verbatim(object):
class Verbatim:
"""Store verbatim PDF command content for later inclusion in the
stream."""
def __init__(self, x):
Expand Down Expand Up @@ -339,7 +339,7 @@ def _paint_path(fill, stroke):
Op.paint_path = _paint_path


class Stream(object):
class Stream:
"""PDF stream object.

This has no pdfRepr method. Instead, call begin(), then output the
Expand Down Expand Up @@ -420,7 +420,7 @@ def _flush(self):
self.compressobj = None


class PdfFile(object):
class PdfFile:
"""PDF file object."""

def __init__(self, filename, metadata=None):
Expand Down Expand Up @@ -2324,7 +2324,7 @@ def finalize(self):
########################################################################


class PdfPages(object):
class PdfPages:
"""
A multi-page PDF file.

Expand Down
6 changes: 3 additions & 3 deletions lib/matplotlib/backends/backend_ps.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
debugPS = 0


class PsBackendHelper(object):
class PsBackendHelper:

def __init__(self):
self._cached = {}
Expand Down Expand Up @@ -950,7 +950,7 @@ def _print_figure(
self.figure.set_edgecolor(edgecolor)

if dryrun:
class NullWriter(object):
class NullWriter:
def write(self, *args, **kwargs):
pass

Expand Down Expand Up @@ -1148,7 +1148,7 @@ def _print_figure_tex(
self.figure.set_edgecolor(edgecolor)

if dryrun:
class NullWriter(object):
class NullWriter:
def write(self, *args, **kwargs):
pass

Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/backends/backend_svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def short_float_fmt(x):
return '{0:f}'.format(x).rstrip('0').rstrip('.')


class XMLWriter(object):
class XMLWriter:
"""
Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/backends/backend_wx.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def debug_on_error(type, value, tb):


@cbook.deprecated("3.1")
class fake_stderr(object):
class fake_stderr:
"""
Wx does strange things with stderr, as it makes the assumption that
there is probably no console. This redirects stderr to the console, since
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/bezier.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def find_bezier_t_intersecting_with_closedpath(
start_inside = middle_inside


class BezierSegment(object):
class BezierSegment:
"""
A simple class of a 2-dimensional bezier segment
"""
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/blocking_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
_log = logging.getLogger(__name__)


class BlockingInput(object):
class BlockingInput:
"""Callable for retrieving events in a blocking way."""

def __init__(self, fig, eventslist=()):
Expand Down
Loading
0