[Zope-Checkins] CVS: Zope3/lib/python/Interface - Implements.py:1.1.2.6 _InterfaceClass.py:1.1.2.6

Jim Fulton jim@zope.com
Mon, 10 Jun 2002 15:34:44 -0400


Update of /cvs-repository/Zope3/lib/python/Interface
In directory cvs.zope.org:/tmp/cvs-serv5490/lib/python/Interface

Modified Files:
      Tag: Zope-3x-branch
	Implements.py _InterfaceClass.py 
Log Message:
Implemented 

http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/IContainerPythonification

Along the way:

- Converted most uses of has_key to use in.

- Fixed a bug in Interface names and namesAndDescriptions methods 
  that caused base class attributes to be missed.



=== Zope3/lib/python/Interface/Implements.py 1.1.2.5 => 1.1.2.6 ===
         while index >= 0:
             i = res[index]
-            if seen.has_key(i):
+            if i in seen:
                 del res[index]
             else:
                 seen[i] = 1


=== Zope3/lib/python/Interface/_InterfaceClass.py 1.1.2.5 => 1.1.2.6 ===
         
         if __module__ is None:
-            if attrs is not None and attrs.has_key('__module__'):
+            if attrs is not None and ('__module__' in attrs):
                 __module__ = attrs['__module__']
                 del attrs['__module__']
             else:
@@ -57,7 +57,7 @@
         self.__bases__=bases
 
         if attrs is None: attrs={}
-        if attrs.has_key('__doc__'):
+        if '__doc__' in attrs:
             if __doc__ is None: __doc__=attrs['__doc__']
             del attrs['__doc__']
 
@@ -130,7 +130,7 @@
         for name in self.__attrs.keys():
             r[name] = 1
         for base in self.__bases__:
-            for name in base.names():
+            for name in base.names(all):
                 r[name] = 1
         return r.keys()
             
@@ -145,7 +145,7 @@
             r[name] = d
             
         for base in self.__bases__:
-            for name, d in base.namesAndDescriptions():
+            for name, d in base.namesAndDescriptions(all):
                 if name not in r:
                     r[name] = d
 
@@ -197,7 +197,7 @@
     def __d(self, dict):
 
         for k, v in self.__attrs.items():
-            if isinstance(v, Method) and not dict.has_key(k):
+            if isinstance(v, Method) and not (k in dict):
                 dict[k]=v
 
         for b in self.__bases__: b.__d(dict)