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

Skip to content

Commit b58f4e8

Browse files
committed
Add note that make_kyword_only() must be the outer most decorator
... to the error message, that gets thrown if it is not.
1 parent 89a3871 commit b58f4e8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/_api/deprecation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,8 @@ def make_keyword_only(since, name, func=None):
437437
assert (name in signature.parameters
438438
and signature.parameters[name].kind == POK), (
439439
f"Matplotlib internal error: {name!r} must be a positional-or-keyword "
440-
f"parameter for {func.__name__}()")
440+
f"parameter for {func.__name__}(). If this happens on a function with a "
441+
f"pyplot wrapper, make sure make_keyword_only() is the outermost decorator.")
441442
names = [*signature.parameters]
442443
name_idx = names.index(name)
443444
kwonly = [name for name in names[name_idx:]

0 commit comments

Comments
 (0)