mirror of
https://github.com/python/cpython.git
synced 2025-08-23 10:16:01 +00:00
return sets instead of tuples from some symtable methods
This commit is contained in:
parent
87069fd8fe
commit
9f9fc68b0f
4 changed files with 16 additions and 13 deletions
|
@ -129,8 +129,8 @@ class Function(SymbolTable):
|
|||
__globals = None
|
||||
|
||||
def __idents_matching(self, test_func):
|
||||
return tuple([ident for ident in self.get_identifiers()
|
||||
if test_func(self._table.symbols[ident])])
|
||||
return frozenset(ident for ident in self.get_identifiers()
|
||||
if test_func(self._table.symbols[ident]))
|
||||
|
||||
def get_parameters(self):
|
||||
if self.__params is None:
|
||||
|
@ -165,7 +165,7 @@ class Class(SymbolTable):
|
|||
d = {}
|
||||
for st in self._table.children:
|
||||
d[st.name] = 1
|
||||
self.__methods = tuple(d)
|
||||
self.__methods = frozenset(d)
|
||||
return self.__methods
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue