GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add PEP 526 AutoCompletion (#1102) · efremovd/pythonVSCode@ad563ee

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • pythonFiles/preview/jedi
    • evaluate
      • __init__.py
    • parser
      • tree.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎pythonFiles/preview/jedi/evaluate/__init__.py‎

Copy file name to clipboardExpand all lines: pythonFiles/preview/jedi/evaluate/__init__.py
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def eval_statement(self, stmt, seek_name=None):
162162
types = finder.check_tuple_assignments(self, types, seek_name)
163163

164164
first_operation = stmt.first_operation()
165-
if first_operation not in ('=', None) and not isinstance(stmt, er.InstanceElement): # TODO don't check for this.
165+
if first_operation not in ('=', None) and not isinstance(stmt, er.InstanceElement) and first_operation.type == 'operator': # TODO don't check for this.
166166
# `=` is always the last character in aug assignments -> -1
167167
operator = copy.copy(first_operation)
168168
operator.value = operator.value[:-1]
@@ -327,6 +327,8 @@ def _eval_element_not_cached(self, element):
327327
types = types
328328
elif element.type == 'eval_input':
329329
types = self._eval_element_not_cached(element.children[0])
330+
elif element.type == 'annassign':
331+
types = self.eval_element(element.children[1])
330332
else:
331333
types = precedence.calculate_children(self, element.children)
332334
debug.dbg('eval_element result %s', types)
Collapse file

‎pythonFiles/preview/jedi/parser/tree.py‎

Copy file name to clipboardExpand all lines: pythonFiles/preview/jedi/parser/tree.py
+8-3Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,9 +1522,14 @@ class ExprStmt(BaseNode, DocstringMixin):
15221522
__slots__ = ()
15231523

15241524
def get_defined_names(self):
1525-
return list(chain.from_iterable(_defined_names(self.children[i])
1526-
for i in range(0, len(self.children) - 2, 2)
1527-
if '=' in self.children[i + 1].value))
1525+
names = []
1526+
if self.children[1].type == 'annassign':
1527+
names = _defined_names(self.children[0])
1528+
return list(chain.from_iterable(
1529+
_defined_names(self.children[i])
1530+
for i in range(0, len(self.children) - 2, 2)
1531+
if '=' in self.children[i + 1].value)
1532+
) + names
15281533

15291534
def get_rhs(self):
15301535
"""Returns the right-hand-side of the equals."""

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.