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

Skip to content

Commit be31aa3

Browse files
committed
Make most arguments to OffsetBox classes keyword only
1 parent 314f3f2 commit be31aa3

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

lib/matplotlib/offsetbox.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -533,8 +533,7 @@ class PaddedBox(OffsetBox):
533533
it when rendering.
534534
"""
535535

536-
@_api.make_keyword_only("3.6", name="draw_frame")
537-
def __init__(self, child, pad=0., draw_frame=False, patch_attrs=None):
536+
def __init__(self, child, pad=0., *, draw_frame=False, patch_attrs=None):
538537
"""
539538
Parameters
540539
----------
@@ -715,8 +714,8 @@ class TextArea(OffsetBox):
715714
child text.
716715
"""
717716

718-
@_api.make_keyword_only("3.6", name="textprops")
719717
def __init__(self, s,
718+
*,
720719
textprops=None,
721720
multilinebaseline=False,
722721
):
@@ -929,8 +928,7 @@ class AnchoredOffsetbox(OffsetBox):
929928
'center': 10,
930929
}
931930

932-
@_api.make_keyword_only("3.6", name="pad")
933-
def __init__(self, loc,
931+
def __init__(self, loc, *,
934932
pad=0.4, borderpad=0.5,
935933
child=None, prop=None, frameon=True,
936934
bbox_to_anchor=None,
@@ -1103,8 +1101,7 @@ class AnchoredText(AnchoredOffsetbox):
11031101
AnchoredOffsetbox with Text.
11041102
"""
11051103

1106-
@_api.make_keyword_only("3.6", name="pad")
1107-
def __init__(self, s, loc, pad=0.4, borderpad=0.5, prop=None, **kwargs):
1104+
def __init__(self, s, loc, *, pad=0.4, borderpad=0.5, prop=None, **kwargs):
11081105
"""
11091106
Parameters
11101107
----------
@@ -1144,8 +1141,7 @@ def __init__(self, s, loc, pad=0.4, borderpad=0.5, prop=None, **kwargs):
11441141

11451142
class OffsetImage(OffsetBox):
11461143

1147-
@_api.make_keyword_only("3.6", name="zoom")
1148-
def __init__(self, arr,
1144+
def __init__(self, arr, *,
11491145
zoom=1,
11501146
cmap=None,
11511147
norm=None,
@@ -1229,8 +1225,7 @@ def __str__(self):
12291225
return "AnnotationBbox(%g,%g)" % (self.xy[0], self.xy[1])
12301226

12311227
@_docstring.dedent_interpd
1232-
@_api.make_keyword_only("3.6", name="xycoords")
1233-
def __init__(self, offsetbox, xy,
1228+
def __init__(self, offsetbox, xy, *,
12341229
xybox=None,
12351230
xycoords='data',
12361231
boxcoords=None,

0 commit comments

Comments
 (0)