[Zope3-checkins] SVN: Zope3/trunk/src/zope/interface/ Fix issue
453: Update docstrings to reflect behaviour of implementedBy and
Philipp von Weitershausen
philikon at philikon.de
Sat Sep 17 06:20:10 EDT 2005
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/trunk/src/zope/interface/_zope_interface_coptimizations.c
U Zope3/trunk/src/zope/interface/interface.py
-=-
Modified: Zope3/trunk/src/zope/interface/_zope_interface_coptimizations.c
===================================================================
--- Zope3/trunk/src/zope/interface/_zope_interface_coptimizations.c 2005-09-16 20:56:14 UTC (rev 38500)
+++ Zope3/trunk/src/zope/interface/_zope_interface_coptimizations.c 2005-09-17 10:20:09 UTC (rev 38501)
@@ -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/trunk/src/zope/interface/interface.py
===================================================================
--- Zope3/trunk/src/zope/interface/interface.py 2005-09-16 20:56:14 UTC (rev 38500)
+++ Zope3/trunk/src/zope/interface/interface.py 2005-09-17 10:20:09 UTC (rev 38501)
@@ -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