Re: [Interface-dev] Re: [Zope3-dev] tagged value handling inconsequent for interface methods and attributes and interfaces themself
Stephan Richter wrote: On Monday 24 October 2005 16:44, Jim Fulton wrote: 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. Okay, in this case I'll implement a mapping interface, instead an attribute one. Is that the change you were hinting at? I guess. The current api doesn't bother me enough to think hard about it. :) Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://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
Re: [Interface-dev] Re: [Zope3-dev] tagged value handling inconsequent for interface methods and attributes and interfaces themself
On Monday 24 October 2005 16:44, Jim Fulton wrote: > > 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. Okay, in this case I'll implement a mapping interface, instead an attribute one. Is that the change you were hinting at? 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
Re: [Interface-dev] Re: [Zope3-dev] tagged value handling inconsequent for interface methods and attributes and interfaces themself
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-1714http://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
Re: [Interface-dev] Re: [Zope3-dev] tagged value handling inconsequent for interface methods and attributes and interfaces themself
On 10/24/05, Stephan Richter <[EMAIL PROTECTED]> wrote: > Any comments before I spend time writing this up? Sounds like a good approach to me. I'd like something a little nicer to work with than the current model. -Fred -- Fred L. Drake, Jr. "Society attacks early, when the individual is helpless." --B.F. Skinner ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com