mirror of
https://github.com/python/cpython
synced 2024-10-14 19:05:40 +00:00
simplify this expression
This commit is contained in:
parent
a56d036db5
commit
500c6ef67f
|
@ -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 @@ def get_parameters(self):
|
|||
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue