diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-08-20 02:33:00 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-08-20 02:33:00 (GMT) |
commit | 3938a90a4a8008b8ef6f26ee4b820ce146211001 (patch) | |
tree | c24dd558c515a292a07d311a46f7adf62d9ae4b9 /Lib/symtable.py | |
parent | 9f9fc68b0fb279e5774d56bcee932d66d02ba369 (diff) | |
download | cpython-3938a90a4a8008b8ef6f26ee4b820ce146211001.zip cpython-3938a90a4a8008b8ef6f26ee4b820ce146211001.tar.gz cpython-3938a90a4a8008b8ef6f26ee4b820ce146211001.tar.bz2 |
Merged revisions 65885,65892,65894,65898 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r65885 | benjamin.peterson | 2008-08-19 17:06:11 -0500 (Tue, 19 Aug 2008) | 1 line
check that the parser module can handle the new keyword syntax
........
r65892 | benjamin.peterson | 2008-08-19 20:27:30 -0500 (Tue, 19 Aug 2008) | 1 line
add a NEWS note for new args syntax
........
r65894 | benjamin.peterson | 2008-08-19 20:44:45 -0500 (Tue, 19 Aug 2008) | 2 lines
newSymbolTable is not public API
........
r65898 | benjamin.peterson | 2008-08-19 21:15:42 -0500 (Tue, 19 Aug 2008) | 1 line
fix silly errors of mine
........
Diffstat (limited to 'Lib/symtable.py')
-rw-r--r-- | Lib/symtable.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Lib/symtable.py b/Lib/symtable.py index ac9396c..9387a67 100644 --- a/Lib/symtable.py +++ b/Lib/symtable.py @@ -8,15 +8,14 @@ from _symtable import (USE, DEF_GLOBAL, DEF_LOCAL, DEF_PARAM, import weakref -__all__ = ["symtable", "SymbolTable", "newSymbolTable", "Class", - "Function", "Symbol"] +__all__ = ["symtable", "SymbolTable", "Class", "Function", "Symbol"] def symtable(code, filename, compile_type): raw = _symtable.symtable(code, filename, compile_type) for top in raw.values(): if top.name == 'top': break - return newSymbolTable(top, filename) + return _newSymbolTable(top, filename) class SymbolTableFactory: def __init__(self): @@ -36,7 +35,7 @@ class SymbolTableFactory: obj = self.__memo[key] = self.new(table, filename) return obj -newSymbolTable = SymbolTableFactory() +_newSymbolTable = SymbolTableFactory() class SymbolTable(object): @@ -111,12 +110,12 @@ class SymbolTable(object): return [self.lookup(ident) for ident in self.get_identifiers()] def __check_children(self, name): - return [newSymbolTable(st, self._filename) + return [_newSymbolTable(st, self._filename) for st in self._table.children if st.name == name] def get_children(self): - return [newSymbolTable(st, self._filename) + return [_newSymbolTable(st, self._filename) for st in self._table.children] |