Move implementation of getParent to zope.location?
There are two functions in zope.traversing.api, getParent and getParents, that are rather closely related. The former is implemented right in that module while the latter adapts its argument to zope.location.interfaces.ILocationInfo and calls getParents() on that. Why is getParent not a part of ILocationInfo? If there's no good reason, I'd propose adding getParent() to the interface and changing the getParent function in zope.traversing to work similarly to getParents, i.e. call a method on an ILocationInfo adapter. -- Thomas
Thomas Lotze wrote:
There are two functions in zope.traversing.api, getParent and getParents, that are rather closely related. The former is implemented right in that module while the latter adapts its argument to zope.location.interfaces.ILocationInfo and calls getParents() on that.
Why is getParent not a part of ILocationInfo? If there's no good reason, I'd propose adding getParent() to the interface and changing the getParent function in zope.traversing to work similarly to getParents, i.e. call a method on an ILocationInfo adapter.
One question to ask is whether getParent and getParents are used all over the place or just by zope.traversing. If they're only used by zope.traversing we might not want to move them to a more general place, but perhaps we can even see about removing them. But really, +1 to moving these functions to zope.location. Regards, Martijn
Martijn Faassen wrote:
One question to ask is whether getParent and getParents are used all over the place or just by zope.traversing. If they're only used by zope.traversing we might not want to move them to a more general place, but perhaps we can even see about removing them.
getParent is used by a number of zope.app.* packages (apidoc, container, dependable, onlinehelp, preference, rotterdam, pythonpage, workflow). Its only other occurrence is in zope.traversing where it is defined, but not used. getParents is used by zope.app.* packages as well (rotterdam, tree, workflow) and definitions of it occur in zope.location and zope.traversing, where it isn't used either, though. Seeing this now, I agree to removing the functions provided nobody objects against removing parts of the API that might be depended on by client code out there. (Both functions are actually exported by zope.traversing.api.) -- Thomas
On Wed, Aug 12, 2009 at 3:26 AM, Thomas Lotze<thomas@thomas-lotze.de> wrote: ...
getParent is used by a number of zope.app.* packages (apidoc, container, dependable, onlinehelp, preference, rotterdam, pythonpage, workflow). Its only other occurrence is in zope.traversing where it is defined, but not used.
getParents is used by zope.app.* packages as well (rotterdam, tree, workflow) and definitions of it occur in zope.location and zope.traversing, where it isn't used either, though.
Seeing this now, I agree to removing the functions provided nobody objects against removing parts of the API that might be depended on by client code out there. (Both functions are actually exported by zope.traversing.api.)
I object to removing API functions that client code might use. (Was that a trick questions?) What is the point of this exercise? Jim -- Jim Fulton
Thomas Lotze wrote:
Martijn Faassen wrote:
One question to ask is whether getParent and getParents are used all over the place or just by zope.traversing. If they're only used by zope.traversing we might not want to move them to a more general place, but perhaps we can even see about removing them.
getParent is used by a number of zope.app.* packages (apidoc, container, dependable, onlinehelp, preference, rotterdam, pythonpage, workflow). Its only other occurrence is in zope.traversing where it is defined, but not used.
getParents is used by zope.app.* packages as well (rotterdam, tree, workflow) and definitions of it occur in zope.location and zope.traversing, where it isn't used either, though.
Seeing this now, I agree to removing the functions provided nobody objects against removing parts of the API that might be depended on by client code out there. (Both functions are actually exported by zope.traversing.api.)
I think that means we can't remove it. I'd say move it. Regards, Martijn
participants (3)
-
Jim Fulton -
Martijn Faassen -
Thomas Lotze