File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -171,6 +171,11 @@ def get_children(self):
171171 return [_newSymbolTable (st , self ._filename )
172172 for st in self ._table .children ]
173173
174+ def get_cells (self ):
175+ """Return a list of cell variable names in the table."""
176+ return [s .get_name () for s in self .get_symbols () if s .is_cell ()]
177+
178+
174179
175180def _get_scope (flags ): # like _PyST_GetScope()
176181 return (flags >> SCOPE_OFF ) & SCOPE_MASK
@@ -230,13 +235,6 @@ def get_frees(self):
230235 self .__frees = self .__idents_matching (is_free )
231236 return self .__frees
232237
233- def get_cells (self ):
234- """Return a tuple of cells in the function."""
235- if self .__cells is None :
236- is_cell = lambda x : _get_scope (x ) == CELL
237- self .__cells = self .__idents_matching (is_cell )
238- return self .__cells
239-
240238
241239class Class (SymbolTable ):
242240
You can’t perform that action at this time.
0 commit comments