Jean-Marc Orliaguet wrote:
[snip]


excuse me, but can someone explain what problem the pattern / workaround is supposed to fix, does it create and return a default annotation value in case an annotation key does not exist? shouldn't the annotation machinery be "fixed" instead to provide getAnnotation(..., default=...) ?

I thought I described it in my initial post.

I was looking for a way to register annotations for objects (and create them if they aren't there yet) without having to write fairly long bits of code for each annotation factory.

I just want to be able to say:

myannotation = IFoo(obj)

where IFoo is the interface of an annotation of the obj. The only place I worry about it being an annotation is in the registration code. No need to import anything else from that package. Whether it needs to create a new annotation or get an existing one is an implementation detail.

Regards,

Martijn
_______________________________________________
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