[Python-Dev] Alternative path suggestion

Giovanni Bajo rasky at develer.com
Sat May 6 01:12:33 CEST 2006


Noam Raphael <noamraph at gmail.com> wrote:

> The only drawback I can see in using a logical representation is that
> giving a path object to functions which expect a path string won't
> work. The immediate solution is to simply use str(p) instead of p. The
> long-term solution is to make all related functions accept a path
> object.


I'm not an expert in this field, but I believe that if you can make your Path
object support the so-called buffer interface, it would be directly usable for
functions like open() without an explicit conversion.

Giovanni Bajo



More information about the Python-Dev mailing list