[Twisted-Python] All use cases of getComponent
I'd like to have a list of all classes that use getComponent (Componentized, Adapter - anything else?) and the expected behaviour - do people override it, etc.. I'm working on Zope3 port of components and trying to figure out how to do backwards-compat (Zope3 has __conforms__ instead of getComponent). -- Itamar Shtull-Trauring http://itamarst.org Looking for a job -- http://itamarst.org/resume.html
At 08:46 PM 4/18/04 -0400, Itamar Shtull-Trauring wrote:
I'd like to have a list of all classes that use getComponent (Componentized, Adapter - anything else?) and the expected behaviour - do people override it, etc..
I'm working on Zope3 port of components and trying to figure out how to do backwards-compat (Zope3 has __conforms__ instead of getComponent).
Are you sure? Googling __conforms__ only finds a bunch of stuff from the types-sig back in 1999. Perhaps you mean __conform__, as defined by PEP 246?
On Sun, 2004-04-18 at 22:50, Phillip J. Eby wrote:
Perhaps you mean __conform__, as defined by PEP 246?
Yep, my bad. -- Itamar Shtull-Trauring http://itamarst.org Looking for a job -- http://itamarst.org/resume.html
At 11:21 PM 4/18/04 -0400, Itamar Shtull-Trauring wrote:
On Sun, 2004-04-18 at 22:50, Phillip J. Eby wrote:
Perhaps you mean __conform__, as defined by PEP 246?
Yep, my bad.
Okay, well __conform__ is for an object to implement adaptation. That is, if object 'x' has a __conform__ attribute, then 'IFoo(x)' will first call 'x.__conform__(IFoo)', and if a non-None object is returned, that's what will be used as the result of 'IFoo(x)'. Is that anything at all like what getComponent() does?
On Mon, 2004-04-19 at 09:36, Phillip J. Eby wrote:
Okay, well __conform__ is for an object to implement adaptation. That is, if object 'x' has a __conform__ attribute, then 'IFoo(x)' will first call 'x.__conform__(IFoo)', and if a non-None object is returned, that's what will be used as the result of 'IFoo(x)'.
Is that anything at all like what getComponent() does?
The semantics are pretty similar, yes. -- Itamar Shtull-Trauring http://itamarst.org Looking for a job -- http://itamarst.org/resume.html
participants (2)
-
Itamar Shtull-Trauring
-
Phillip J. Eby