[Zope3-dev] comments on Guido's diary

Steve Alexander steve@cat-box.net
Thu, 12 Dec 2002 12:59:18 +0000


>>Look in Zope/App/Traversing/tests/testConvenienceFunctions.py
>>You'll find the class attributes _good_locations and _bad_locations that 
>>have the examples of valid and invalid locations used to test the 
>>functions that convert between formats for locations.
>>
>>According to this, a list is not a valid location.
>>
>>The empty tuple is not a valid location. Perhaps it should be. I'd 
>>welcome discussion and suggestions from people who have read through 
>>this unit-test.
> 
> 
> As Guido says, I'd suggest making () be valid and the equivalent of '.'
> in Unix paths. I think that's the natural semantics. It will certainly
> make code regular, and there's currently no way to express '.' in tuple
> form.

Here's my take on this:

The convenience functions locationAsUnicode and locationAsTuple are 
meant to deal with locations. A location is always absolute. So, () 
should not be valid. I think 'location' in Zope 3 means 'absolute location'.

A pathAsUnicode or a pathAsTuple function would accept () to return 
relative paths.

--
Steve Alexander