[Python-checkins] CVS: python/dist/src/Lib symtable.py,1.3,1.4

Jeremy Hylton jhylton@users.sourceforge.net
Mon, 16 Apr 2001 11:43:20 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv11008/Lib

Modified Files:
	symtable.py 
Log Message:
Fix three PyChecker-detected gotchas.

Import OPT_ symbols from _symtable.
Define has_exec() and has_import_star().


Index: symtable.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/symtable.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** symtable.py	2001/03/29 04:36:08	1.3
--- symtable.py	2001/04/16 18:43:18	1.4
***************
*** 5,9 ****
  from _symtable import USE, DEF_GLOBAL, DEF_LOCAL, DEF_PARAM, \
       DEF_STAR, DEF_DOUBLESTAR, DEF_INTUPLE, DEF_FREE, \
!      DEF_FREE_GLOBAL, DEF_FREE_CLASS, DEF_IMPORT, DEF_BOUND
  
  import weakref
--- 5,10 ----
  from _symtable import USE, DEF_GLOBAL, DEF_LOCAL, DEF_PARAM, \
       DEF_STAR, DEF_DOUBLESTAR, DEF_INTUPLE, DEF_FREE, \
!      DEF_FREE_GLOBAL, DEF_FREE_CLASS, DEF_IMPORT, DEF_BOUND, \
!      OPT_IMPORT_STAR, OPT_EXEC, OPT_BARE_EXEC
  
  import weakref
***************
*** 98,103 ****
  
      def has_exec(self):
!         return bool()
  
      def get_identifiers(self):
          return self._table.symbols.keys()
--- 99,109 ----
  
      def has_exec(self):
!         """Return true if the scope uses exec"""
!         return bool(self._table.optimized & (OPT_EXEC | OPT_BARE_EXEC))
  
+     def has_import_star(self):
+         """Return true if the scope uses import *"""
+         return bool(self._table.optimized & OPT_IMPORT_STAR)
+ 
      def get_identifiers(self):
          return self._table.symbols.keys()
***************
*** 191,198 ****
  
      def is_vararg(self):
!         return bool(self.flag & DEF_STAR)
  
      def is_keywordarg(self):
!         return bool(self.__flags & DEF_STARSTAR)
  
      def is_local(self):
--- 197,204 ----
  
      def is_vararg(self):
!         return bool(self.__flags & DEF_STAR)
  
      def is_keywordarg(self):
!         return bool(self.__flags & DEF_DOUBLESTAR)
  
      def is_local(self):