Skip to content

Commit 256106a

Browse files
committed
make more clarify
1 parent a1006a0 commit 256106a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

flask_restful/reqparse.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,14 @@ def __init__(self, argument_class=Argument, namespace_class=Namespace):
194194
self.argument_class = argument_class
195195
self.namespace_class = namespace_class
196196

197-
def add_argument(self, name, *args, **kwargs):
197+
def add_argument(self, *args, **kwargs):
198198
"""Adds an argument to be parsed. See :class:`Argument`'s constructor
199199
for documentation on the available options.
200200
"""
201-
if isinstance(name, self.argument_class):
202-
self.args.append(name)
201+
if len(args) == 1 and isinstance(args[0], self.argument_class):
202+
self.args.append(args[0])
203203
else:
204-
self.args.append(self.argument_class(name, *args, **kwargs))
204+
self.args.append(self.argument_class(*args, **kwargs))
205205
return self
206206

207207
def parse_args(self, req=None):

0 commit comments

Comments
 (0)