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

Eric Snow ericsnowcurrently at gmail.com
Sat Oct 6 19:29:37 CEST 2012


On Sat, Oct 6, 2012 at 6:09 AM, Antoine Pitrou <solipsis at pitrou.net> wrote:
> On Fri, 5 Oct 2012 23:16:55 -0600
> Eric Snow <ericsnowcurrently at gmail.com>
> wrote:
>> Each namedtuple has a _replace() method that's is used to generate a
>> new instance with one or more attributes changed.  We could do
>> something similar here:
>
> The concrete Path objects' replace() method already maps to
> os.replace().
> Note os.replace() is new in 3.3 and is a portable always-overwriting
> alternative to os.rename():
> http://docs.python.org/dev/library/os.html#os.replace

Sure.  The point is that the API include some method that works this
way, regardless of what the name ultimately is.  :)  Stephen J.
Turnbull called it subst() and expanded on the idea.

-eric



More information about the Python-ideas mailing list