Repository: matplotlib/matplotlib
File: lib/matplotlib/widgets.py (Python)

Code before:

    useblit : bool, default: True
        Use blitting for faster drawing if supported by the backend.
        See the tutorial :ref:`blitting`
        for details.

    horizOn : bool, default: False
        Whether to draw the horizontal line.

    vertOn : bool, default: True
        Whether to draw the vertical line.

    Other Parameters
    ----------------
    **lineprops
        `.Line2D` properties that control the appearance of the lines.
        See also `~.Axes.axhline`.

    Examples
    --------
    See :doc:`/gallery/widgets/multicursor`.
    """

    def __init__(self, *args, useblit=True, horizOn=False, vertOn=True,
                 **lineprops):
        # Deprecation of canvas as the first attribute. When the deprecation exprires:
        # - change the signature to __init__(self, axes, *, ...)
        # - delete the "Call signatures" block in the docstring
        # - delete this block
        kwargs = {k: lineprops.pop(k)
                  for k in list(lineprops) if k in ("canvas", "axes")}
        params = _api.select_matching_signature(
            [lambda axes: locals(), lambda canvas, axes: locals()], *args, **kwargs)
        if "canvas" in params:
            _api.warn_deprecated(
                "3.11",
                message="The canvas parameter in MultiCursor is unused and deprecated "
                "since  %(since)s. Please remove it and call MultiCursor(axes) "
                "instead of MultiCursor(canvas, axes). The latter will start raising "
                "an error in %(removal)s"
            )
        axes = params["axes"]

        self.axes = axes
        self.horizOn = horizOn
        self.vertOn = vertOn

        self._canvas_infos = {
            ax.get_figure(root=True).canvas:
                {"cids": [], "background": None} for ax in axes}


Review comment (suggestion):
```suggestion
        # Deprecation of canvas as the first attribute. When the deprecation expires:
```

Code after:

    useblit : bool, default: True
        Use blitting for faster drawing if supported by the backend.
        See the tutorial :ref:`blitting`
        for details.

    horizOn : bool, default: False
        Whether to draw the horizontal line.

    vertOn : bool, default: True
        Whether to draw the vertical line.

    Other Parameters
    ----------------
    **lineprops
        `.Line2D` properties that control the appearance of the lines.
        See also `~.Axes.axhline`.

    Examples
    --------
    See :doc:`/gallery/widgets/multicursor`.
    """

    def __init__(self, *args, useblit=True, horizOn=False, vertOn=True,
                 **lineprops):
        # Deprecation of canvas as the first attribute. When the deprecation expires:
        # - change the signature to __init__(self, axes, *, ...)
        # - delete the "Call signatures" block in the docstring
        # - delete this block
        kwargs = {k: lineprops.pop(k)
                  for k in list(lineprops) if k in ("canvas", "axes")}
        params = _api.select_matching_signature(
            [lambda axes: locals(), lambda canvas, axes: locals()], *args, **kwargs)
        if "canvas" in params:
            _api.warn_deprecated(
                "3.11",
                message="The canvas parameter in MultiCursor is unused and deprecated "
                "since  %(since)s. Please remove it and call MultiCursor(axes) "
                "instead of MultiCursor(canvas, axes). The latter will start raising "
                "an error in %(removal)s"
            )
        axes = params["axes"]

        self.axes = axes
        self.horizOn = horizOn
        self.vertOn = vertOn

        self._canvas_infos = {
            ax.get_figure(root=True).canvas:
                {"cids": [], "background": None} for ax in axes}