[Zope3-checkins] CVS: Zope3/src/zope/interface - interfaces.py:1.14

Jim Fulton jim@zope.com
Mon, 2 Jun 2003 07:08:13 -0400


Update of /cvs-repository/Zope3/src/zope/interface
In directory cvs.zope.org:/tmp/cvs-serv20533/src/zope/interface

Modified Files:
	interfaces.py 
Log Message:
Added __nonzero__ to interface specification interface so you can do
tests like:

  if providedBy(ob): ...

to test whether an object has any interfaces.


=== Zope3/src/zope/interface/interfaces.py 1.13 => 1.14 ===
--- Zope3/src/zope/interface/interfaces.py:1.13	Sat May  3 12:36:36 2003
+++ Zope3/src/zope/interface/interfaces.py	Mon Jun  2 07:08:13 2003
@@ -508,6 +508,10 @@
         not raise an error. Doing so has no effect.
         """
 
+    def __nonzero__():
+        """Return a true value of the interface specification is non-empty
+        """
+
     __signature__ = Attribute("""A specification signature
 
     The signature should change if any of the interfaces in the