Adapter for class with slots

Wolfgang Schnerring <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <[email protected]>
Hello,

I've stumbled upon a wrinkly edge case (bug?) in zope.component.

What I was trying to do is register an AbsoluteURL adapter for
lovely.remotetask.processor.ProcessorRequest objects, and since they
don't implement a specific interface, I thought I'd use the class
itself as the required component. But registering the adapter for 
"* lovely.remotetask.processor.ProcessorRequest" fails with a strange
TypeError (see below). The reason is that the class inherits from
zope.publisher.base.BaseRequests which uses __slots__.

The minimal reproduction recipe to see the error is this:

    class Slotted(object):
        __slots__ = ('__provides__')

    zope.component.provideAdapter(
        lambda x: True, (Slotted,), zope.interface.Interface)

Which will raise
  File "/home/wosc/.python-eggs/zope.component-3.7.1-py2.6.egg/zope/component/registry.py",
  line 419, in _getAdapterRequired
      elif not ISpecification.providedBy(r):
  TypeError: 'member_descriptor' object is not callable

Why is this? Can this be made to work? How would I go about
investigating that?

Thanks,
Wolfgang
_______________________________________________
Zope-Dev maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.