Chris Withers wrote:
Hi All,
What's the difference between these two?
implementedBy is what I meant to use, by I braino'ed isImplementedBy
instead.
def providedBy(object):
"""Test whether the interface is implemented by the object
Return true of the object asserts that it implements the
interface, including asserting that it implements an extended
interface.
"""
def implementedBy(class_):
"""Test whether the interface is implemented by instances of
the class
Return true of the class asserts that its instances implement the
interface, including asserting that they implement an extended
interface.
"""
...
def isImplementedBy(self, ob):
warnings.warn(
"isImplementedBy has been renamed to providedBy",
DeprecationWarning, stacklevel=2,
)
return self.providedBy(ob)
That's 2.10, grep lib/python/zope/interface on your own instance in case
it's changed. However, IFoo.providedBy(obj) and
IFoo.implementedBy(obj.__class__) should be the same.
Rather than getting an AttributeError, I just got unexpected behaviour :-(
You know as well as anyone that this is a pointless message without any
more detail.
Martin
_______________________________________________
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com