From e617c9d3440a95148bd4667f7b51a92ddb8b3399 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Wed, 5 Aug 2020 23:52:38 +0200 Subject: [PATCH] Formatting --- jedi/inference/syntax_tree.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/jedi/inference/syntax_tree.py b/jedi/inference/syntax_tree.py index 18694d87..192328f3 100644 --- a/jedi/inference/syntax_tree.py +++ b/jedi/inference/syntax_tree.py @@ -287,14 +287,12 @@ def infer_atom(context, atom): state = context.inference_state if atom.type == 'name': # This is the first global lookup. - stmt = tree.search_ancestor( - atom, 'expr_stmt', 'lambdef', 'if_stmt' - ) or atom - if stmt.type == 'lambdef': - stmt = atom + stmt = tree.search_ancestor(atom, 'expr_stmt', 'lambdef', 'if_stmt') or atom if stmt.type == 'if_stmt': if not any(n.start_pos <= atom.start_pos < n.end_pos for n in stmt.get_test_nodes()): stmt = atom + elif stmt.type == 'lambdef': + stmt = atom position = stmt.start_pos if _is_annotation_name(atom): # Since Python 3.7 (with from __future__ import annotations),