Changeset 388 for python/vendor/current/Lib/symtable.py
- Timestamp:
- Mar 19, 2014, 11:11:30 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/vendor/current/Lib/symtable.py
r2 r388 4 4 from _symtable import (USE, DEF_GLOBAL, DEF_LOCAL, DEF_PARAM, 5 5 DEF_IMPORT, DEF_BOUND, OPT_IMPORT_STAR, OPT_EXEC, OPT_BARE_EXEC, 6 SCOPE_OFF, SCOPE_MASK, FREE, GLOBAL_IMPLICIT, GLOBAL_EXPLICIT) 7 8 import warnings 6 SCOPE_OFF, SCOPE_MASK, FREE, GLOBAL_IMPLICIT, GLOBAL_EXPLICIT, CELL, LOCAL) 7 9 8 import weakref 10 9 … … 12 11 13 12 def symtable(code, filename, compile_type): 14 raw = _symtable.symtable(code, filename, compile_type) 15 for top in raw.itervalues(): 16 if top.name == 'top': 17 break 13 top = _symtable.symtable(code, filename, compile_type) 18 14 return _newSymbolTable(top, filename) 19 15 … … 139 135 def get_locals(self): 140 136 if self.__locals is None: 141 self.__locals = self.__idents_matching(lambda x:x & DEF_BOUND) 137 locs = (LOCAL, CELL) 138 test = lambda x: ((x >> SCOPE_OFF) & SCOPE_MASK) in locs 139 self.__locals = self.__idents_matching(test) 142 140 return self.__locals 143 141 … … 192 190 return bool(self.__scope in (GLOBAL_IMPLICIT, GLOBAL_EXPLICIT)) 193 191 194 def is_vararg(self):195 warnings.warn("is_vararg() is obsolete and will be removed",196 DeprecationWarning, 2)197 return False198 199 def is_keywordarg(self):200 warnings.warn("is_keywordarg() is obsolete and will be removed",201 DeprecationWarning, 2)202 return False203 204 192 def is_declared_global(self): 205 193 return bool(self.__scope == GLOBAL_EXPLICIT) … … 216 204 def is_assigned(self): 217 205 return bool(self.__flags & DEF_LOCAL) 218 219 def is_in_tuple(self):220 warnings.warn("is_in_tuple() is obsolete and will be removed",221 DeprecationWarning, 2)222 206 223 207 def is_namespace(self):
Note:
See TracChangeset
for help on using the changeset viewer.