On Sep 26, 2007, at 3:37 PM, Dieter Maurer wrote:

Jim Fulton wrote at 2007-9-26 15:10 -0400:
Jim Fulton wrote at 2007-9-26 11:29 -0400:

Actually, that is not the case. If x already provides IFoo, then in
the first case, the existing object is retuned. Nothing is
instantiated.  OTOH, in:

  getMultiAdapter([x], IFoo)

  getAdapter(x, IFoo)

either there is an error or some factory will be called. x won't be
returned unless the factory happens to return it.

Is this not an irrelevant implementation detail?

No, the specified behavior is different.

Hm. But "getAdapter" and "getMultiAdapter" may return "x" as well
(when the factory decides to do this).

Thus, why is it relevant?

Because they don't take into account what x already provides. They will always call some factory. Also, they never call __conforms__.


Jim Fulton
Zope Corporation

Zope3-dev mailing list
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to