summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-06-28 19:30:36 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-06-28 19:30:36 (GMT)
commit500c6ef67fa4d0209cd424997fa0478d1187897b (patch)
treed4304c2528d966cd444419971328b4b1d29fed89
parenta56d036db528993125573963392ffad1ee332e04 (diff)
downloadcpython-500c6ef67fa4d0209cd424997fa0478d1187897b.zip
cpython-500c6ef67fa4d0209cd424997fa0478d1187897b.tar.gz
cpython-500c6ef67fa4d0209cd424997fa0478d1187897b.tar.bz2
simplify this expression
-rw-r--r--Lib/symtable.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/symtable.py b/Lib/symtable.py
index 7277f5e..39c1a80 100644
--- a/Lib/symtable.py
+++ b/Lib/symtable.py
@@ -3,7 +3,7 @@
import _symtable
from _symtable import (USE, DEF_GLOBAL, DEF_LOCAL, DEF_PARAM,
DEF_IMPORT, DEF_BOUND, OPT_IMPORT_STAR, SCOPE_OFF, SCOPE_MASK, FREE,
- LOCAL, GLOBAL_IMPLICIT, GLOBAL_EXPLICIT)
+ LOCAL, GLOBAL_IMPLICIT, GLOBAL_EXPLICIT, CELL)
import weakref
@@ -137,8 +137,8 @@ class Function(SymbolTable):
def get_locals(self):
if self.__locals is None:
- test = lambda x: (((x >> SCOPE_OFF) & SCOPE_MASK) == LOCAL or
- (x & DEF_BOUND and not x & DEF_GLOBAL))
+ locs = (LOCAL, CELL)
+ test = lambda x: ((x >> SCOPE_OFF) & SCOPE_MASK) in locs
self.__locals = self.__idents_matching(test)
return self.__locals