mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
Add is_declared_global() which distinguishes between implicit and
explicit global variables.
This commit is contained in:
parent
9d2ee5ded2
commit
1c157ea984
2 changed files with 5 additions and 0 deletions
|
@ -190,6 +190,9 @@ class Symbol(object):
|
|||
def is_global(self):
|
||||
return bool(self.__scope in (GLOBAL_IMPLICIT, GLOBAL_EXPLICIT))
|
||||
|
||||
def is_declared_global(self):
|
||||
return bool(self.__scope == GLOBAL_EXPLICIT)
|
||||
|
||||
def is_local(self):
|
||||
return bool(self.__flags & DEF_BOUND)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue