Skip to content

Commit 8576912

Browse files
committed
strip-on-all-operators
1 parent 812a262 commit 8576912

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

IPython/core/completer.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,6 @@ def attr_matches(self, text):
11351135
_ATTR_MATCH_RE = re.compile(r"(.+)\.(\w*)$")
11361136

11371137
def _strip_code_before_operator(self, code: str) -> str:
1138-
operators = ["=", "==", "!=", ">=", "<=", ">", "<"]
11391138
o_parens = {"(", "[", "{"}
11401139
c_parens = {")", "]", "}"}
11411140

@@ -1164,7 +1163,7 @@ def _strip_code_before_operator(self, code: str) -> str:
11641163
nesting_level += 1
11651164
elif t.string in c_parens:
11661165
nesting_level -= 1
1167-
elif t.string in operators and nesting_level == 0:
1166+
elif t.string != "." and nesting_level == 0:
11681167
encountered_operator = True
11691168
after_operator = []
11701169
continue
@@ -1190,7 +1189,6 @@ def _attr_matches(
11901189
pass
11911190

11921191
obj = self._evaluate_expr(expr)
1193-
11941192
if obj is not_found:
11951193
return [], ""
11961194

0 commit comments

Comments
 (0)