[Checkins] SVN: zope.interface/branches/regebro-python3/ Removed implementer() support for Extension classes, cleanup, upped the version to 3.6.0.

Lennart Regebro regebro at gmail.com
Sat Dec 5 06:01:11 EST 2009


Log message for revision 106216:
  Removed implementer() support for Extension classes, cleanup, upped the version to 3.6.0.
  

Changed:
  U   zope.interface/branches/regebro-python3/CHANGES.txt
  U   zope.interface/branches/regebro-python3/setup.py
  U   zope.interface/branches/regebro-python3/src/zope/interface/declarations.py
  U   zope.interface/branches/regebro-python3/src/zope/interface/tests/test_odd_declarations.py

-=-
Modified: zope.interface/branches/regebro-python3/CHANGES.txt
===================================================================
--- zope.interface/branches/regebro-python3/CHANGES.txt	2009-12-05 10:29:47 UTC (rev 106215)
+++ zope.interface/branches/regebro-python3/CHANGES.txt	2009-12-05 11:01:07 UTC (rev 106216)
@@ -2,7 +2,7 @@
 *******
 
 ==================
-3.5.3 (unreleased)
+3.6.0 (unreleased)
 ==================
 
 ...

Modified: zope.interface/branches/regebro-python3/setup.py
===================================================================
--- zope.interface/branches/regebro-python3/setup.py	2009-12-05 10:29:47 UTC (rev 106215)
+++ zope.interface/branches/regebro-python3/setup.py	2009-12-05 11:01:07 UTC (rev 106216)
@@ -106,7 +106,7 @@
     from build_ext_2 import optional_build_ext
     
 setup(name='zope.interface',
-      version = '3.5.3dev',
+      version = '3.6.0py3',
       url='http://pypi.python.org/pypi/zope.interface',
       license='ZPL 2.1',
       description='Interfaces for Python',

Modified: zope.interface/branches/regebro-python3/src/zope/interface/declarations.py
===================================================================
--- zope.interface/branches/regebro-python3/src/zope/interface/declarations.py	2009-12-05 10:29:47 UTC (rev 106215)
+++ zope.interface/branches/regebro-python3/src/zope/interface/declarations.py	2009-12-05 11:01:07 UTC (rev 106216)
@@ -457,20 +457,11 @@
 
     if spec.inherit is not None:
 
-        try:
-            for c in spec.inherit.__bases__:
-                b = implementedBy(c)
-                if b not in seen:
-                    seen[b] = 1
-                    bases.append(b)
-        except:
-            import pdb;pdb.set_trace()
-            for c in spec.inherit.__bases__:
-                b = implementedBy(c)
-                if b not in seen:
-                    seen[b] = 1
-                    bases.append(b)
-            
+        for c in spec.inherit.__bases__:
+            b = implementedBy(c)
+            if b not in seen:
+                seen[b] = 1
+                bases.append(b)            
 
     spec.__bases__ = tuple(bases)
 
@@ -497,17 +488,6 @@
         except AttributeError:
             raise TypeError("Can't declare implements", ob)
         return ob
-        #if isinstance(ob, (FunctionType, MethodType)):
-            #spec = Implements(*self.interfaces)
-            #try:
-                #ob.__implemented__ = spec
-            #except AttributeError:
-                #raise TypeError("Can't declare implements", ob)
-            #return ob
-        #else:
-            ## Assume it's a class:
-            #classImplements(ob, *self.interfaces)
-            #return ob            
 
 class implementer_only:
 

Modified: zope.interface/branches/regebro-python3/src/zope/interface/tests/test_odd_declarations.py
===================================================================
--- zope.interface/branches/regebro-python3/src/zope/interface/tests/test_odd_declarations.py	2009-12-05 10:29:47 UTC (rev 106215)
+++ zope.interface/branches/regebro-python3/src/zope/interface/tests/test_odd_declarations.py	2009-12-05 11:01:07 UTC (rev 106216)
@@ -43,10 +43,12 @@
 # from zope.interface import classProvides
 
 class A(Odd):
-    implements(I1)
+    pass
+classImplements(A, I1)
 
 class C(A, B):
-    implements(I31)
+    pass
+classImplements(C, I31)
 
 
 class Test(unittest.TestCase):
@@ -67,10 +69,12 @@
         self.failIf(providedBy(c).extends(I5))
 
         class COnly(A, B):
-            implementsOnly(I31)
+            pass
+        classImplementsOnly(COnly, I31)
 
         class D(COnly):
-            implements(I5)
+            pass
+        classImplements(D, I5)
 
         classImplements(D, I5)
 
@@ -89,7 +93,8 @@
 
         class COnly(A, B): __implemented__ = I31
         class D(COnly):
-            implements(I5)
+            pass
+        classImplements(D, I5)
 
         classImplements(D, I5)
         c = D()
@@ -141,13 +146,16 @@
         class IB(Interface): pass
         class IC(Interface): pass
         class A(Odd):
-            implements(IA1, IA2)
+            pass
+        classImplements(A, IA1, IA2)
 
         class B(Odd):
-            implements(IB)
+            pass
+        classImplements(B, IB)
 
         class C(A, B):
-            implements(IC)
+            pass
+        classImplements(C, IC)
 
 
         ob = C()
@@ -184,10 +192,12 @@
         class I2(I1): pass
 
         class C1(Odd):
-          implements(I2)
+            pass
+        classImplements(C1, I2)
 
         class C2(C1):
-          implements(I3)
+            pass
+        classImplements(C2, I3)
 
         self.assertEqual([i.getName() for i in implementedBy(C2)],
                          ['I3', 'I2'])



More information about the checkins mailing list