summaryrefslogtreecommitdiffstats
path: root/Lib/symtable.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/symtable.py')
-rw-r--r--Lib/symtable.py18
1 files changed, 6 insertions, 12 deletions
diff --git a/Lib/symtable.py b/Lib/symtable.py
index 15549ee..4498335 100644
--- a/Lib/symtable.py
+++ b/Lib/symtable.py
@@ -35,19 +35,13 @@ class SymbolTableFactory:
newSymbolTable = SymbolTableFactory()
-def bool(x):
- """Helper to force boolean result to 1 or 0"""
- if x:
- return 1
- return 0
-
def is_free(flags):
if (flags & (USE | DEF_FREE)) \
and (flags & (DEF_LOCAL | DEF_PARAM | DEF_GLOBAL)):
- return 1
+ return True
if flags & DEF_FREE_CLASS:
- return 1
- return 0
+ return True
+ return False
class SymbolTable:
def __init__(self, raw_table, filename):
@@ -206,10 +200,10 @@ class Symbol:
def is_free(self):
if (self.__flags & (USE | DEF_FREE)) \
and (self.__flags & (DEF_LOCAL | DEF_PARAM | DEF_GLOBAL)):
- return 1
+ return True
if self.__flags & DEF_FREE_CLASS:
- return 1
- return 0
+ return True
+ return False
def is_imported(self):
return bool(self.__flags & DEF_IMPORT)