[Zope3-checkins] CVS: Zope3/lib/python/Interface/Registry - _flatten.py:1.2
Jim Fulton
jim@zope.com
Mon, 18 Nov 2002 15:37:48 -0500
Update of /cvs-repository/Zope3/lib/python/Interface/Registry
In directory cvs.zope.org:/tmp/cvs-serv3830
Modified Files:
_flatten.py
Log Message:
Added an option to tack None onto the end of the list of flattened
interfaces.
=== Zope3/lib/python/Interface/Registry/_flatten.py 1.1 => 1.2 ===
--- Zope3/lib/python/Interface/Registry/_flatten.py:1.1 Thu Aug 1 11:33:43 2002
+++ Zope3/lib/python/Interface/Registry/_flatten.py Mon Nov 18 15:37:47 2002
@@ -21,7 +21,7 @@
from Interface import Interface
-def _flatten(implements):
+def _flatten(implements, include_None=0):
"""Flatten an implements spec to a list of interfaces
The list includes all base interfaces of the interface(s) in
@@ -39,6 +39,9 @@
seen[interface] = 1
flattened.append(interface)
flattened.reverse()
+
+ if include_None:
+ flattened.append(None)
return flattened