Jim Fulton wrote:
Martijn Faassen wrote:

Jim Fulton wrote:

This is one bit I was missing, thanks.

Unfortunately I read in zope/interface/README.txt that the 'implementer' function cannot be used for classes yet, so this will change the design somewhat (I was using __call__, looks like I'll have to exploit lexical scoping and generate a function on the fly).

No.  You can use it on an instance of the class.  You want something

  class FactoryFactory:

      def __init__(self):
      # initialize a new factory
          implementer(self, someinterfacethatmyinstancesimplement)

I'm stupid. Right!

Then this and the __component_adapts__ hack should be enough to make it work (still an unpleasant hack, that). With that I suspect I should even be able to steal the implementedBy and the adaptedBy from the annotation itself, which would mean I'd only need to spell it out there.

Thanks again!

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

Reply via email to