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

Jim Fulton jim at zope.com
Mon Jun 2 08:08:13 EDT 2003


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




More information about the Zodb-checkins mailing list