diff --git a/jedi/parser/representation.py b/jedi/parser/representation.py index a9078f98..dcef2f46 100644 --- a/jedi/parser/representation.py +++ b/jedi/parser/representation.py @@ -1013,14 +1013,11 @@ isinstance(c, (tokenize.Token, Operator)) else unicode(c) elif tok in brackets.keys(): level += 1 - if level == -1 and tok in closing_brackets \ - or tok in added_breaks \ - or level == 0 and ( - tok == ',' - or maybe_dict and tok == ':' - or is_assignment(tok) - and break_on_assignment - ): + if level == -1 or level == 0 and ( + tok == ',' + or tok in added_breaks + or maybe_dict and tok == ':' + or is_assignment(tok) and break_on_assignment): end_pos = end_pos[0], end_pos[1] - 1 break diff --git a/test/completion/basic.py b/test/completion/basic.py index 53f98246..93d79be0 100644 --- a/test/completion/basic.py +++ b/test/completion/basic.py @@ -131,7 +131,7 @@ a = [a if 1.0 else '' for a in [1] if [1.0]] #? int() str() a[0] -# with a dict in between +# with a dict literal #? int() [a for a,b in {1:2}.items()][0]