1
0
forked from VimPlug/jedi

Issues with argument clinic parser.

This commit is contained in:
Dave Halter
2014-12-08 15:45:40 +01:00
parent 01b9361b33
commit 94ea2c1096
2 changed files with 4 additions and 3 deletions

View File

@@ -63,6 +63,7 @@ def argument_clinic(string, want_obj=False, want_scope=False):
"""
clinic_args = []
allow_kwargs = False
optional = False
while string:
# Optional arguments have to begin with a bracket. And should always be
# at the end of the arguments. This is therefore not a proper argument
@@ -73,9 +74,9 @@ def argument_clinic(string, want_obj=False, want_scope=False):
if not match.group(2): # A slash -> allow named arguments
allow_kwargs = True
continue
optional = match.group(1)
optional = optional or bool(match.group(1))
word = match.group(2)
clinic_args.append((word, bool(optional), allow_kwargs))
clinic_args.append((word, optional, allow_kwargs))
def f(func):
def wrapper(evaluator, obj, arguments):
@@ -121,7 +122,6 @@ def builtins_type(evaluator, objects, bases, dicts):
return []
else:
return [o.base for o in objects if isinstance(o, er.Instance)]
return []
class SuperInstance(er.Instance):