[Zope3-checkins] SVN: Zope3/branches/Zope-3.1/src/zope/interface/ Merge from the trunk: Log message for revision 38501:

Philipp von Weitershausen philikon at philikon.de
Sat Sep 17 12:27:01 EDT 2005


Log message for revision 38506:
  Merge from the trunk: Log message for revision 38501:
    Fix issue 453: Update docstrings to reflect behaviour of implementedBy and
    Specification.implementedBy when argument is not a class nor a callable factory.
  

Changed:
  U   Zope3/branches/Zope-3.1/src/zope/interface/_zope_interface_coptimizations.c
  U   Zope3/branches/Zope-3.1/src/zope/interface/interface.py

-=-
Modified: Zope3/branches/Zope-3.1/src/zope/interface/_zope_interface_coptimizations.c
===================================================================
--- Zope3/branches/Zope-3.1/src/zope/interface/_zope_interface_coptimizations.c	2005-09-17 13:48:05 UTC (rev 38505)
+++ Zope3/branches/Zope-3.1/src/zope/interface/_zope_interface_coptimizations.c	2005-09-17 16:27:00 UTC (rev 38506)
@@ -302,7 +302,8 @@
 
 
 static char Spec_implementedBy__doc__[] = 
-"Test whether the specification is implemented by instances of a class"
+"Test whether the specification is implemented by a class or factory.\n"
+"Raise TypeError if argument is neither a class nor a callable."
 ;
 
 static PyObject *
@@ -490,7 +491,8 @@
 
 static struct PyMethodDef m_methods[] = {
   {"implementedBy", (PyCFunction)implementedBy, METH_O,
-   "Interfaces implemented by instances of a class"},
+   "Interfaces implemented by a class or factory.\n"
+   "Raises TypeError if argument is neither a class nor a callable."},
   {"getObjectSpecification", (PyCFunction)getObjectSpecification, METH_O,
    "Get an object's interfaces (internal api)"},
   {"providedBy", (PyCFunction)providedBy, METH_O,
@@ -550,4 +552,3 @@
   if (PyModule_AddObject(m, "ClassProvidesBase", (PyObject *)&CPBType) < 0)
     return;
 }
-

Modified: Zope3/branches/Zope-3.1/src/zope/interface/interface.py
===================================================================
--- Zope3/branches/Zope-3.1/src/zope/interface/interface.py	2005-09-17 13:48:05 UTC (rev 38505)
+++ Zope3/branches/Zope-3.1/src/zope/interface/interface.py	2005-09-17 16:27:00 UTC (rev 38506)
@@ -116,7 +116,8 @@
         return self in spec._implied
 
     def implementedBy(self, cls):
-        """Do instances of the given class implement the interface?"""
+        """Test whether the specification is implemented by a class or factory.
+        Raise TypeError if argument is neither a class nor a callable."""
         spec = implementedBy(cls)
         return self in spec._implied
 



More information about the Zope3-Checkins mailing list