Unstated assumptions about the IAnnotations interface
Bug #98462 reported by
Jacob Holm
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 3 |
Won't Fix
|
Medium
|
Unassigned | ||
zope.annotation |
Fix Released
|
Medium
|
Tres Seaver |
Bug Description
Parts of zope 3 assume that the result of adapting an object to IAnnotations support "__contains__", "__iter__" and "items". This is true for the standard adapter(s) but is not part of the documented interface.
__contains__ is easy to implement in terms of the existing interface, so adding this to the interface is only a small burden on implementers.
__iter__ and items may be more difficult to support in some cases.
Changed in zope3: | |
status: | New → Confirmed |
Changed in zope.annotation: | |
importance: | Undecided → Medium |
status: | New → Confirmed |
Changed in zope3: | |
status: | Confirmed → Won't Fix |
To post a comment you must log in.
For example, grepping for "in annotations" finds examples of all three (one false positive filtered out):
/zope3/ src/optionstora ge/__init_ _.py: src/optionstora ge/__init_ _.py: src/zope/ app/apidoc/ codemodule/ browser/ introspector. py: items() : src/zope/ app/zopeappgene rations/ evolve5. py: src/zope/ fssync/ server/ syncer. py:
if OptionStorageKey in annotations:
/zope3/
if OptionStorageKey in annotations:
/zope3/
for key, value in annotations.
/zope3/
if DCkey in annotations:
/zope3/
for key in annotations: