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
_______________________________________________
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to