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

Skip to content

Commit d0d2413

Browse files
committed
Remove _print_supported_values parameter from _api.check_in_list
The only usage was removed in 8cde5a8.
1 parent f084447 commit d0d2413

2 files changed

Lines changed: 4 additions & 9 deletions

File tree

lib/matplotlib/_api/__init__.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def type_name(tp):
107107
type_name(type(v))))
108108

109109

110-
def check_in_list(values, /, *, _print_supported_values=True, **kwargs):
110+
def check_in_list(values, /, **kwargs):
111111
"""
112112
For each *key, value* pair in *kwargs*, check that *value* is in *values*;
113113
if not, raise an appropriate ValueError.
@@ -119,8 +119,6 @@ def check_in_list(values, /, *, _print_supported_values=True, **kwargs):
119119
120120
Note: All values must support == comparisons.
121121
This means in particular the entries must not be numpy arrays.
122-
_print_supported_values : bool, default: True
123-
Whether to print *values* when raising ValueError.
124122
**kwargs : dict
125123
*key, value* pairs as keyword arguments to find in *values*.
126124
@@ -148,9 +146,8 @@ def check_in_list(values, /, *, _print_supported_values=True, **kwargs):
148146
# the individual `val == values[i]` ValueError surface.
149147
exists = False
150148
if not exists:
151-
msg = f"{val!r} is not a valid value for {key}"
152-
if _print_supported_values:
153-
msg += f"; supported values are {', '.join(map(repr, values))}"
149+
msg = (f"{val!r} is not a valid value for {key}"
150+
f"; supported values are {', '.join(map(repr, values))}")
154151
raise ValueError(msg)
155152

156153

lib/matplotlib/_api/__init__.pyi

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ class classproperty(Any):
3838
def check_isinstance(
3939
types: type | tuple[type | None, ...], /, **kwargs: Any
4040
) -> None: ...
41-
def check_in_list(
42-
values: Sequence[Any], /, *, _print_supported_values: bool = ..., **kwargs: Any
43-
) -> None: ...
41+
def check_in_list(values: Sequence[Any], /, **kwargs: Any) -> None: ...
4442
def check_shape(shape: tuple[int | None, ...], /, **kwargs: NDArray) -> None: ...
4543
def getitem_checked(
4644
mapping: Mapping[Any, _T], /, _error_cls: type[Exception], **kwargs: Any

0 commit comments

Comments
 (0)