Skip to content

Commit 500c6ef

Browse files
committed
simplify this expression
1 parent a56d036 commit 500c6ef

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Lib/symtable.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import _symtable
44
from _symtable import (USE, DEF_GLOBAL, DEF_LOCAL, DEF_PARAM,
55
DEF_IMPORT, DEF_BOUND, OPT_IMPORT_STAR, SCOPE_OFF, SCOPE_MASK, FREE,
6-
LOCAL, GLOBAL_IMPLICIT, GLOBAL_EXPLICIT)
6+
LOCAL, GLOBAL_IMPLICIT, GLOBAL_EXPLICIT, CELL)
77

88
import weakref
99

@@ -137,8 +137,8 @@ def get_parameters(self):
137137

138138
def get_locals(self):
139139
if self.__locals is None:
140-
test = lambda x: (((x >> SCOPE_OFF) & SCOPE_MASK) == LOCAL or
141-
(x & DEF_BOUND and not x & DEF_GLOBAL))
140+
locs = (LOCAL, CELL)
141+
test = lambda x: ((x >> SCOPE_OFF) & SCOPE_MASK) in locs
142142
self.__locals = self.__idents_matching(test)
143143
return self.__locals
144144

0 commit comments

Comments
 (0)