Stephan Richter wrote:
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?

This won't work for tags whos keys are not python identifiers.
I'd like to encourage people to use ids (dotted names or urls) for
tags.

Jim

--
Jim Fulton           mailto:[EMAIL PROTECTED]       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org
_______________________________________________
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