[MERGE] update osutils.walkdirs docstring to mention abspath

John Arbash Meinel john at arbash-meinel.com
Mon Aug 7 17:18:27 BST 2006


Adeodato Simó wrote:
> Hi.
> 
> When looking into using osutils.walkdirs, I noticed the documentation
> did not mention that abspath was included in the yielded tuples, the
> attached bundle fixes that.
> 
> Cheers,
> 
> 

Well, technically it isn't the absolute path. It is the path appended to
the 'top' that you passed in. And 'relpath' is the relative path with
'prefix' prepended.

I wrote about this a while ago, and agree that the documentation needs
some cleanup.

I'm a little concerned to have walkdirs show up in an 0.9 release, when
we don't have any client code using it (Robert's Tree.walkdirs() stuff).

So I really would rather not have committed to the exact api until we
have some clients using it, and have a chance to tweak it for performance.

For example, while we did create 'relpath' and 'abspath', they can be
simply regenerated with a dirrelpath + '/' + name. So is it better to
consume the extra memory at the expense of a later string concatenation?

There are some other minor api-preserving operations that can be done
which should improve performance. (For example, we could return
dirrelpath with a '/' suffix already, so you need to do one less string
concatenation, etc.

I'm not sure the best thing. But it might be best to just make
'osutils.walkdirs' private in the 0.9 release.

John
=:->


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060807/0e2a7458/attachment.pgp 


More information about the bazaar mailing list