diff --git a/jedi/api/__init__.py b/jedi/api/__init__.py index c44c6c25..ff75b271 100644 --- a/jedi/api/__init__.py +++ b/jedi/api/__init__.py @@ -494,7 +494,7 @@ class Script(object): origins = cache.cache_call_signatures(_callable, user_stmt) debug.speed('func_call followed') - return [classes.CallSignature(self._evaluator, o, index, call) for o in origins + return [classes.CallSignature(self._evaluator, o, call, index) for o in origins if o.isinstance(er.Function, er.Instance, er.Class) or isinstance(o, compiled.CompiledObject) and o.type() != 'module'] diff --git a/jedi/api/classes.py b/jedi/api/classes.py index 9839c302..664beddc 100644 --- a/jedi/api/classes.py +++ b/jedi/api/classes.py @@ -547,7 +547,7 @@ class CallSignature(object): It knows what functions you are currently in. e.g. `isinstance(` would return the `isinstance` function. without `(` it would return nothing. """ - def __init__(self, evaluator, executable, index, call): + def __init__(self, evaluator, executable, call, index): self._evaluator = evaluator self._executable = executable self.index = index @@ -572,8 +572,10 @@ class CallSignature(object): @property def bracket_start(self): - """ The indent of the bracket that is responsible for the last function - call. """ + """ + The indent of the bracket that is responsible for the last function + call. + """ c = self._call while c.next is not None: c = c.next diff --git a/test/test_api/test_call_signatures.py b/test/test_api/test_call_signatures.py index 225c3e72..c32a18e6 100644 --- a/test/test_api/test_call_signatures.py +++ b/test/test_api/test_call_signatures.py @@ -2,6 +2,7 @@ import textwrap from ..helpers import TestCase from jedi import Script +from jedi._compatibility import is_py33 class TestCallSignatures(TestCase): @@ -167,7 +168,12 @@ class TestParams(TestCase): return signatures[0].params def test_param_name(self): - p = self.params('''int(''') - # int is defined as: `int(x[, base])` - assert p[0].name == 'x' - assert p[1].name == 'base' + if not is_py33: + p = self.params('''int(''') + # int is defined as: `int(x[, base])` + assert p[0].name == 'x' + assert p[1].name == 'base' + + p = self.params('''open(something,''') + assert p[0].name in ['file', 'name'] + assert p[1].name == 'mode'