[Zope3-dev] Notations for paths
Phillip J. Eby
pje@telecommunity.com
Thu, 19 Dec 2002 12:01:05 -0500
At 04:04 PM 12/19/02 +0000, Steve Alexander wrote:
>So, there are special functions for correctly converting between the
>string form and the tuple form.
>
>I've had to correct a number of bugs where the naive conversion had been
>used. These bugs were somewhat tricky to track down, becuase the effects
>didn't point to this as the obvious cause.
I think you missed my point. This is *precisely* why Zope shouldn't use an
unencapsulated representation like tuples for this in the first place!
Nobody should be doing any conversions directly. There should be a
location class, and only strings or instances of the location class should
be allowed. Code which uses locations should invoke the location
constructor on any input, to ensure that strings become locations.