summaryrefslogtreecommitdiffstats
path: root/Lib/symtable.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2002-04-04 22:55:58 (GMT)
committerTim Peters <tim.peters@gmail.com>2002-04-04 22:55:58 (GMT)
commitbc0e9108261693b6278687f4fb4709ff76c2e543 (patch)
treeafef5d4734034ed0268950cf06321aefd4154ff3 /Lib/symtable.py
parent2f486b7fa6451b790b154e6e4751239d69d46952 (diff)
downloadcpython-bc0e9108261693b6278687f4fb4709ff76c2e543.zip
cpython-bc0e9108261693b6278687f4fb4709ff76c2e543.tar.gz
cpython-bc0e9108261693b6278687f4fb4709ff76c2e543.tar.bz2
Convert a pile of obvious "yes/no" functions to return bool.
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)