[Python-ideas] PEP 428 - object-oriented filesystem paths

Oleg Broytman phd at phdru.name
Sat Oct 6 21:05:34 CEST 2012


On Sat, Oct 06, 2012 at 11:44:02AM -0700, Ethan Furman <ethan at stoneleaf.us> wrote:
> Oleg Broytman wrote:
> >   IMO there is no need to
> >replace parts beyond drive/name/extension. To "replace" root or path
> >components just construct a new Path.
> 
> And if your new path is exactly the same as the old, /except/ for
> the root?  Are you suggesting something like:
> 
> --> p = PureNTPath('c:/orders/12345/abc67890.dbf')
> --> q = '//another_machine/share' + p.parts() + p.filename
> 
> ?

   Yes. Even if the new path differs from the old by one letter
somewhere in a middle component.
   "Practicality beats purity". We need to see real use cases to decide
what is really needed.

Oleg.
-- 
     Oleg Broytman            http://phdru.name/            phd at phdru.name
           Programmers don't die, they just GOSUB without RETURN.



More information about the Python-ideas mailing list