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

Skip to content

Commit 0734b86

Browse files
committed
MNT: invert logic of _has_varargs
1 parent 0d6cd40 commit 0734b86

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/matplotlib/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1610,17 +1610,17 @@ def param(func):
16101610
if not python_has_signature:
16111611
arg_spec = inspect.getargspec(func)
16121612
_arg_names = arg_spec.args
1613-
_has_no_varargs = arg_spec.varargs is None
1613+
_has_varargs = arg_spec.varargs is not None
16141614
_has_varkwargs = arg_spec.keywords is not None
16151615
else:
16161616
sig = signature(func)
1617-
_has_no_varargs = True
1617+
_has_varargs = False
16181618
_has_varkwargs = False
16191619
_arg_names = []
16201620
params = list(sig.parameters.values())
16211621
for p in params:
16221622
if p.kind is Parameter.VAR_POSITIONAL:
1623-
_has_no_varargs = False
1623+
_has_varargs = True
16241624
elif p.kind is Parameter.VAR_KEYWORD:
16251625
_has_varkwargs = True
16261626
else:
@@ -1639,7 +1639,7 @@ def param(func):
16391639
# positional args can end up in **kwargs, so only *varargs make
16401640
# problems.
16411641
# http://stupidpythonideas.blogspot.de/2013/08/arguments-and-parameters.html
1642-
if _has_no_varargs:
1642+
if not _has_varargs:
16431643
# all args are "named", so no problem
16441644
# remove the first "ax" / self arg
16451645
arg_names = _arg_names[1:]

0 commit comments

Comments
 (0)