BTW, defining 'objectValues' (and 'objectIds' / 'objectItems') as
returning empty sequences for a leaf object is not a "dirty hack": it
is a classic application of the "composite pattern"[1]. Having leaves
share the abstract container interface makes writing recursive code
vastly simpler. I strongly doubt that this is the only place in the
Zope2 codebase which interacts badly with sub-objects which do not define
those methods.
The patch looks reasonable. It needs a test.
BTW, defining 'objectValues' (and 'objectIds' / 'objectItems') as
returning empty sequences for a leaf object is not a "dirty hack": it
is a classic application of the "composite pattern"[1]. Having leaves
share the abstract container interface makes writing recursive code
vastly simpler. I strongly doubt that this is the only place in the
Zope2 codebase which interacts badly with sub-objects which do not define
those methods.
[1] http:// en.wikipedia. org/wiki/ Composite_ pattern