[z3-five] Marker interfaces in Five 1.0.2

whit d.w.morriss at gmail.com
Fri Feb 9 23:31:56 CET 2007


Philipp von Weitershausen wrote:
> whit wrote:
>> Andreas Jung wrote:
>>> Hi,
>>>
>>> don't stone me to death but is there a way to attach marker interfaces
>>> of objects in Five 1.0.2?
>>>
>>> Andreas
>>>
>> does this not work?
>>
>> from zope.interface import directlyProvidedBy
>> from zope.interface import directlyProvides
>>
>> def mark(ob, interface):
>>      directlyProvides(ob, directlyProvidedBy(ob), interface)
> 
> Actually, you probably might want to stick the marker interfaces to the 
> beginning:
> 
>    def mark(ob, *interfaces):
>        directlyProvides(ob, *interfaces, directlyProvidedBy(ob))
> 
> Since Zope 3.2 this function is part of the zope.interface package and 
> called "alsoProvides".
> 
> 
yup... otherwise the other interfaces will resolve first.

-w

-- 

------ d. whit morriss ------
- senior engineer, opencore -
- http://www.openplans.org  -
- m: 415-710-8975           -

"If you don't know where you are,
  you don't know anything at all" 


Dr. Edgar Spencer, Ph.D., 1995



More information about the z3-five mailing list