[Zope3-Users] Dynamic __providedBy__

Rudá Porto Filgueiras rudazz at gmail.com
Fri Feb 15 00:26:43 EST 2008


I'm was curious and try to dig into..

In zope.interfaces.declarations.py  __providedBy__ is an instance of
objectSpecificationDescriptor implemented in C
and there is one Python version too in ObjectSpecificationDescriptorPy.
It's a descriptor that try to acess __provides__ of instance and class
object. ??

Maybe the question could be: Is possible change the class used as an
__providedBy__ and it will use an alternative way to return the
interfaces dinamically provided and mantain the original semantic?

On Thu, Feb 14, 2008 at 8:22 PM, Martin Aspeli <optilude at gmx.net> wrote:
> Hi!
>
>  I may have a use case where I need an instance to provide marker
>  interfaces dynamically. That is, under certain conditions I want the
>  type to say it provides a particular marker interface, and otherwise it
>  doesn't. It still needs to support the usual by-class and
>  directly-provided idioms for providing interfaces, including
>  directlyProvides()/alsoProvides().
>
>  Is such a thing possible? Perhaps one could make __providedBy__ a
>  dynamic property or something? Or is this a very bad idea?  :)
>
>  Martin
>
>  --
>  Author of `Professional Plone Development`, a book for developers who
>  want to work with Plone. See http://martinaspeli.net/plone-book
>
>  _______________________________________________
>  Zope3-users mailing list
>  Zope3-users at zope.org
>  http://mail.zope.org/mailman/listinfo/zope3-users
>



-- 
Rudá Porto Filgueiras
Weimar Consultoria

http://python-blog.blogspot.com

Hospedagem Plone, Zope e Python?
http://www.pytown.com


More information about the Zope3-users mailing list