From 81f3b940e8e5e3ccc4a53a73ebb4bd566273c46d Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Fri, 18 Jul 2014 15:36:50 +0200 Subject: [PATCH] dicts should not be used to check against in get_defined_names, because they cannot contain a defined name (lists and tuples can) so just ignore them., fixes #417 --- jedi/parser/representation.py | 2 +- test/test_api/test_call_signatures.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jedi/parser/representation.py b/jedi/parser/representation.py index b21dd548..da13dfba 100644 --- a/jedi/parser/representation.py +++ b/jedi/parser/representation.py @@ -934,7 +934,7 @@ isinstance(c, (tokenize.Token, Operator)) else unicode(c) def search_calls(calls): for call in calls: - if isinstance(call, Array): + if isinstance(call, Array) and call.type != Array.DICT: for stmt in call: search_calls(stmt.expression_list()) elif isinstance(call, Call): diff --git a/test/test_api/test_call_signatures.py b/test/test_api/test_call_signatures.py index faf72b3d..12a575ee 100644 --- a/test/test_api/test_call_signatures.py +++ b/test/test_api/test_call_signatures.py @@ -227,7 +227,7 @@ def test_no_signature(): assert len(Script(s, column=2).call_signatures()) == 1 -def test_dicts(): +def test_dict_literal_in_incomplete_call(): source = """\ import json