[Interface-dev] Re: [Zope3-dev] tagged value handling inconsequent for interface methods and attributes and interfaces themself

Stephan Richter srichter at cosmos.phy.tufts.edu
Mon Oct 24 16:31:25 EDT 2005


On Wednesday 19 October 2005 05:51, Grégoire Weber wrote:
> while modeling the external API of an application I'd like to use the
> tagged value feature of the interface implementation.
>
> It seems to me that handling tagged values is implemented inconsequently.

I plan to make a proposal that would allow the following:

import zope.interface

class IFoo(zope.interface.Interface):

  attr = zope.interface.Attribute('doc string')

  def method():
    """doc string"""

interfaceTags = zope.interface.interfaces.ITaggedValues(IFoo)
interfaceTags.someVariable = value

attributeTags = zope.interface.interfaces.ITaggedValues(IFoo['attr'])
attributeTags.someVariable = value

methodTags = zope.interface.interfaces.ITaggedValues(IFoo['method'])
methodTags.someVariable = value

Alternatively, I would like to try the following as well:

from zope.interface.interfaces import ITaggedValue

class IFoo(zope.interface.Interface):

  attr = zope.interface.Attribute('doc string')
  ITaggedValues(attr).someVariable = value

Any comments before I spend time writing this up?

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training


More information about the Interface-dev mailing list