diff options
| author | Yury Selivanov <yury@magic.io> | 2016-09-08 20:50:03 -0700 |
|---|---|---|
| committer | Yury Selivanov <yury@magic.io> | 2016-09-08 20:50:03 -0700 |
| commit | f8cb8a16a344ab208fd46876c4b63604987347b8 (patch) | |
| tree | c44caa48291401d1e1e388004d2762513ac88c93 /Lib/symtable.py | |
| parent | 09ad17810c38d1aaae02de69084dd2a8ad9f5cdb (diff) | |
| download | cpython-git-f8cb8a16a344ab208fd46876c4b63604987347b8.tar.gz | |
Issue #27985: Implement PEP 526 -- Syntax for Variable Annotations.
Patch by Ivan Levkivskyi.
Diffstat (limited to 'Lib/symtable.py')
| -rw-r--r-- | Lib/symtable.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/symtable.py b/Lib/symtable.py index 84fec4aa66..b0e52603dc 100644 --- a/Lib/symtable.py +++ b/Lib/symtable.py @@ -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) |
