[Zope3-checkins] SVN: Zope3/trunk/src/zope/interface/adapter.py Removed the lookup1() implementation, since there was an exact duplicate

Stephan Richter srichter at cosmos.phy.tufts.edu
Sun Sep 19 13:10:22 EDT 2004


Log message for revision 27641:
  Removed the lookup1() implementation, since there was an exact duplicate 
  in lookup(). lookup1() now just refers to lookup. 
  
  This eliminates one of two identical implementations of one functionality.
  


Changed:
  U   Zope3/trunk/src/zope/interface/adapter.py


-=-
Modified: Zope3/trunk/src/zope/interface/adapter.py
===================================================================
--- Zope3/trunk/src/zope/interface/adapter.py	2004-09-19 11:42:04 UTC (rev 27640)
+++ Zope3/trunk/src/zope/interface/adapter.py	2004-09-19 17:10:20 UTC (rev 27641)
@@ -380,22 +380,8 @@
         return default
 
     def lookup1(self, required, provided, name='', default=None):
-        s = self.get(required)
-        byname = s.get(provided)
-        if byname:
-            value = byname.get(name)
-        else:
-            value = None
+        return self.lookup((required,), provided, name, default)
 
-        if value is None:
-            byname = self._default.get(provided)
-            if byname:
-                value = byname.get(name, default)
-            else:
-                return default
-
-        return value
-
     def adapter_hook(self, interface, object, name='', default=None):
         """Hook function used when calling interfaces.
 



More information about the Zope3-Checkins mailing list