mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue #27985: Implement PEP 526 -- Syntax for Variable Annotations.
Patch by Ivan Levkivskyi.
This commit is contained in:
parent
09ad17810c
commit
f8cb8a16a3
45 changed files with 3242 additions and 1308 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
import _symtable
|
||||
from _symtable import (USE, DEF_GLOBAL, DEF_LOCAL, DEF_PARAM,
|
||||
DEF_IMPORT, DEF_BOUND, SCOPE_OFF, SCOPE_MASK, FREE,
|
||||
DEF_IMPORT, DEF_BOUND, DEF_ANNOT, SCOPE_OFF, SCOPE_MASK, FREE,
|
||||
LOCAL, GLOBAL_IMPLICIT, GLOBAL_EXPLICIT, CELL)
|
||||
|
||||
import weakref
|
||||
|
@ -190,6 +190,9 @@ class Symbol(object):
|
|||
def is_local(self):
|
||||
return bool(self.__flags & DEF_BOUND)
|
||||
|
||||
def is_annotated(self):
|
||||
return bool(self.__flags & DEF_ANNOT)
|
||||
|
||||
def is_free(self):
|
||||
return bool(self.__scope == FREE)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue